messageTray: Prevent reentrancy issues in _updateState

The methods we call in _updateState may not be reentrant, so make
sure that we never get into a situation where _updateState, through
some crazy chain of events, calls itself.

https://bugzilla.gnome.org/show_bug.cgi?id=711694
This commit is contained in:
Jasper St. Pierre 2013-11-15 10:34:04 -05:00 committed by Florian Müllner
parent 04551850dd
commit 43f67399a3

View File

@ -2392,6 +2392,13 @@ const MessageTray = new Lang.Class({
// _updateState() figures out what (if anything) needs to be done
// at the present time.
_updateState: function() {
// If our state changes caused _updateState to be called,
// just exit now to prevent reentrancy issues.
if (this._updatingState)
return;
this._updatingState = true;
// Filter out acknowledged notifications.
this._notificationQueue = this._notificationQueue.filter(function(n) {
return !n.acknowledged;
@ -2474,6 +2481,8 @@ const MessageTray = new Lang.Class({
} else if (desktopCloneIsVisible && !desktopCloneShouldBeVisible) {
this._hideDesktopClone();
}
this._updatingState = false;
},
_tween: function(actor, statevar, value, params) {