- Prevent a deadlock when Zotero.wait() was called during initialization
- Don't spin Zotero.mainThread.processNextEvent() forever when translator could not be retrieved
This commit is contained in:
parent
9ce0e47117
commit
91024eb87c
3 changed files with 14 additions and 4 deletions
|
@ -73,10 +73,17 @@ Zotero.IPC = new function() {
|
|||
} else if(msg === "checkInitComplete") {
|
||||
// The Firefox extension sends this to Standalone to tell Standalone to send an
|
||||
// initComplete message when it is fully initialized
|
||||
while(!Zotero.initialized) {
|
||||
Zotero.mainThread.processNextEvent(true)
|
||||
}
|
||||
if(Zotero.initialized) {
|
||||
Zotero.IPC.broadcast("initComplete");
|
||||
} else {
|
||||
var observerService = Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
var _loadObserver = function() {
|
||||
Zotero.IPC.broadcast("initComplete");
|
||||
observerService.removeObserver(_loadObserver, "zotero-loaded");
|
||||
};
|
||||
observerService.addObserver(_loadObserver, "zotero-loaded", false);
|
||||
}
|
||||
} else if(msg === "initComplete") {
|
||||
// Standalone sends this to the Firefox extension to let the Firefox extension
|
||||
// know that Standalone has fully initialized and it should pull the list of
|
||||
|
|
|
@ -349,7 +349,7 @@ Zotero.Translate.Sandbox = {
|
|||
|
||||
Zotero.Translators.get(translation.translator[0], haveTranslatorFunction);
|
||||
if(Zotero.isConnector && Zotero.isFx && !callback) {
|
||||
while(!sandbox) {
|
||||
while(!sandbox && translate._currentState) {
|
||||
Zotero.mainThread.processNextEvent(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -459,6 +459,9 @@ if(appInfo.platformVersion[0] >= 2) {
|
|||
observerService.notifyObservers(Zotero, "zotero-reloaded", null);
|
||||
}
|
||||
|
||||
Zotero.debug('Triggering "zotero-loaded" event');
|
||||
observerService.notifyObservers(Zotero, "zotero-loaded", null);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue