mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 979199 - DataStore should not dispatch events when the window is destroyed, r=ehsan
This commit is contained in:
parent
ac46e15a6e
commit
7c00b37a8f
@ -79,6 +79,7 @@ this.DataStore.prototype = {
|
||||
_revisionId: null,
|
||||
_exposedObject: null,
|
||||
_cursor: null,
|
||||
_shuttingdown: false,
|
||||
|
||||
init: function(aWindow, aName, aOwner, aReadOnly) {
|
||||
debug("DataStore init");
|
||||
@ -96,6 +97,8 @@ this.DataStore.prototype = {
|
||||
let wId = aSubject.QueryInterface(Ci.nsISupportsPRUint64).data;
|
||||
if (wId == self._innerWindowID) {
|
||||
cpmm.removeMessageListener("DataStore:Changed:Return:OK", self);
|
||||
cpmm.sendAsyncMessage("DataStore:UnregisterForMessages");
|
||||
self._shuttingdown = true;
|
||||
self._db.close();
|
||||
}
|
||||
}, "inner-window-destroyed", false);
|
||||
@ -320,6 +323,11 @@ this.DataStore.prototype = {
|
||||
|
||||
this.retrieveRevisionId(
|
||||
function() {
|
||||
// If the window has been destroyed we don't emit the events.
|
||||
if (self._shuttingdown) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If we have an active cursor we don't emit events.
|
||||
if (self._cursor) {
|
||||
return;
|
||||
|
@ -25,6 +25,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
|
||||
this.DataStoreChangeNotifier = {
|
||||
children: [],
|
||||
messages: [ "DataStore:Changed", "DataStore:RegisterForMessages",
|
||||
"DataStore:UnregisterForMessages",
|
||||
"child-process-shutdown" ],
|
||||
|
||||
init: function() {
|
||||
@ -94,6 +95,7 @@ this.DataStoreChangeNotifier = {
|
||||
break;
|
||||
|
||||
case "child-process-shutdown":
|
||||
case "DataStore:UnregisterForMessages":
|
||||
debug("Unregister");
|
||||
|
||||
for (let i = 0; i < this.children.length;) {
|
||||
|
Loading…
Reference in New Issue
Block a user