From 01f740ce69017f6305dd579c2eab55f0076ca6f6 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 12 Dec 2013 14:42:41 -0500 Subject: [PATCH] background: Don't prematurely remove file monitors We need to only remove file monitors when there's no other users of the content... --- js/ui/background.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/background.js b/js/ui/background.js index a56a0af8b..20a3a4030 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -125,7 +125,8 @@ const BackgroundCache = new Lang.Class({ removeImageContent: function(content) { let filename = content.get_filename(); - if (filename && this._fileMonitors[filename]) + let hasOtherUsers = this._images.some(function(content) { return filename == content.get_filename(); }); + if (!hasOtherUsers) delete this._fileMonitors[filename]; this._removeContent(this._images, content);