From cfc7f3682948263ea6313fd750f8a4f7d5e6a0eb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 12 Nov 2016 22:03:06 -0500 Subject: [PATCH] Don't send lockReleased on Standalone restart This prevents Zotero for Firefox from starting up and shutting down when Standalone is just restarting. --- chrome/content/zotero/xpcom/utilities_internal.js | 3 +++ chrome/content/zotero/xpcom/zotero.js | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index 353d10414..1c68b31d5 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -1179,6 +1179,9 @@ Zotero.Utilities.Internal = { */ quitZotero: function(restart=false) { var startup = Services.startup; + if (restart) { + Zotero.restarting = true; + } startup.quit(startup.eAttemptQuit | (restart ? startup.eRestart : 0) ); } } diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 8638acee0..4a8eb226f 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -861,8 +861,10 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); // close DB yield Zotero.DB.closeDatabase(true) - // broadcast that DB lock has been released - Zotero.IPC.broadcast("lockReleased"); + if (!Zotero.restarting) { + // broadcast that DB lock has been released + Zotero.IPC.broadcast("lockReleased"); + } } } catch(e) { Zotero.logError(e);