From 22e0ba3a225f0fd78cc8914697b519fdc4d4f9f8 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 22 May 2015 15:50:27 -0400 Subject: [PATCH] Fix hangs related to data object purging --- chrome/content/zotero/xpcom/data/group.js | 4 +- chrome/content/zotero/xpcom/data/tags.js | 100 +++++++++++----------- chrome/content/zotero/xpcom/zotero.js | 4 +- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/group.js b/chrome/content/zotero/xpcom/data/group.js index 1b8e56f409..635bef276f 100644 --- a/chrome/content/zotero/xpcom/data/group.js +++ b/chrome/content/zotero/xpcom/data/group.js @@ -333,11 +333,11 @@ Zotero.Group.prototype.erase = Zotero.Promise.coroutine(function* () { sql = "DELETE FROM libraries WHERE libraryID=?"; yield Zotero.DB.queryAsync(sql, this.libraryID) - yield Zotero.purgeDataObjects(); - Zotero.Groups.unregister(this.id); Zotero.Notifier.trigger('delete', 'group', this.id, notifierData); }.bind(this)); + + yield Zotero.purgeDataObjects(); }); diff --git a/chrome/content/zotero/xpcom/data/tags.js b/chrome/content/zotero/xpcom/data/tags.js index 3ceef1b7e6..c500cd4c4a 100644 --- a/chrome/content/zotero/xpcom/data/tags.js +++ b/chrome/content/zotero/xpcom/data/tags.js @@ -370,61 +370,61 @@ Zotero.Tags = new function() { tagIDs = Zotero.flattenArguments(tagIDs); } - yield Zotero.DB.executeTransaction(function* () { - yield Zotero.Tags.load(libraryID); - - // Use given tags, as long as they're orphaned - if (tagIDs) { - let sql = "CREATE TEMPORARY TABLE tagDelete (tagID INT PRIMARY KEY)"; - yield Zotero.DB.queryAsync(sql); - for (let i=0; i