Wanda: remove unnecessary destroy signal connection
'destroy' is emitted before the actor is unmapped during destruction, so notify::mapped would emit an exception. Since unmapping is guaranteed, the 'destroy' signal is unnecessary. https://bugzilla.gnome.org/show_bug.cgi?id=684154
This commit is contained in:
parent
70c34baafb
commit
4beba796d7
@ -50,21 +50,12 @@ const WandaIcon = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
createIcon: function(iconSize) {
|
createIcon: function(iconSize) {
|
||||||
if (this._animations)
|
|
||||||
this._animations.destroy();
|
|
||||||
|
|
||||||
if (!this._imageFile) {
|
if (!this._imageFile) {
|
||||||
return new St.Icon({ icon_name: 'face-smile',
|
return new St.Icon({ icon_name: 'face-smile',
|
||||||
icon_size: iconSize });
|
icon_size: iconSize });
|
||||||
}
|
}
|
||||||
|
|
||||||
this._animations = St.TextureCache.get_default().load_sliced_image(this._imageFile, this._imgWidth, this._imgHeight);
|
this._animations = St.TextureCache.get_default().load_sliced_image(this._imageFile, this._imgWidth, this._imgHeight);
|
||||||
this._animations.connect('destroy', Lang.bind(this, function() {
|
|
||||||
if (this._timeoutId)
|
|
||||||
GLib.source_remove(this._timeoutId);
|
|
||||||
this._timeoutId = 0;
|
|
||||||
this._animations = null;
|
|
||||||
}));
|
|
||||||
this._animations.connect('notify::mapped', Lang.bind(this, function() {
|
this._animations.connect('notify::mapped', Lang.bind(this, function() {
|
||||||
if (this._animations.mapped && !this._timeoutId) {
|
if (this._animations.mapped && !this._timeoutId) {
|
||||||
this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, FISH_SPEED, Lang.bind(this, this._update));
|
this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, FISH_SPEED, Lang.bind(this, this._update));
|
||||||
|
Loading…
Reference in New Issue
Block a user