LookingGlass: Correct timeout usage

Calling Mainloop.source_remove() on the timeout ID will not reset it,
and we're already removing the timeout by returning GLib.SOURCE_REMOVE
in the callback.
This commit is contained in:
Bastien Nocera 2014-04-10 21:08:49 +02:00
parent cd2bd7685a
commit 68b2d5fcf0

View File

@ -843,7 +843,7 @@ const LookingGlass = new Lang.Class({
System.gc(); System.gc();
this._timeoutId = Mainloop.timeout_add(500, Lang.bind(this, function () { this._timeoutId = Mainloop.timeout_add(500, Lang.bind(this, function () {
gcIcon.icon_name = 'gnome-fs-trash-full'; gcIcon.icon_name = 'gnome-fs-trash-full';
Mainloop.source_remove(this._timeoutId); this._timeoutId = 0;
return GLib.SOURCE_REMOVE; return GLib.SOURCE_REMOVE;
})); }));
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] gcIcon.icon_name = \'gnome-fs-trash-full\''); GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] gcIcon.icon_name = \'gnome-fs-trash-full\'');