background: Don't prematurely remove file monitors

We need to only remove file monitors when there's no other users
of the content...
This commit is contained in:
Jasper St. Pierre 2013-12-12 14:42:41 -05:00
parent b168ccb605
commit 01f740ce69

View File

@ -125,7 +125,8 @@ const BackgroundCache = new Lang.Class({
removeImageContent: function(content) { removeImageContent: function(content) {
let filename = content.get_filename(); 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]; delete this._fileMonitors[filename];
this._removeContent(this._images, content); this._removeContent(this._images, content);