Don't open a new integration pipe if there is already an integration pipe open. Fixes hangs on shutdown after launching multiple Zotero instances.
This commit is contained in:
parent
ff90005ed2
commit
971dd5c69c
1 changed files with 7 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue