commit 971dd5c69ce5b4cf0d32a2fe6112a3133b9dd99c
parent ff90005ed2b0311a7a4ae11ba4d76e31ac12ba9c
Author: Simon Kornblith <simon@simonster.com>
Date: Wed, 13 Jul 2011 16:41:00 +0000
Don't open a new integration pipe if there is already an integration pipe open. Fixes hangs on shutdown after launching multiple Zotero instances.
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js
@@ -89,6 +89,11 @@ Zotero.Integration = new function() {
// destroy old pipe, if one exists
try {
if(_fifoFile.exists()) {
+ if(_fifoFile.isSpecial() && Zotero.IPC.safePipeWrite(_fifoFile.path, "Zotero test\n")) {
+ Zotero.debug("Integration pipe already open by another instance; not initializing integration pipe");
+ return;
+ }
+
_fifoFile.remove(false);
}
} catch (e) {
@@ -196,6 +201,8 @@ Zotero.Integration = new function() {
*/
function _parseIntegrationPipeCommand(string) {
if(string != "") {
+ if(string === "Zotero test\n") return;
+
// exec command if possible
var parts = string.match(/^([^ \n]*) ([^ \n]*)(?: ([^\n]*))?\n?$/);
if(parts) {