[evolution] [EActivityBar] Do not remove timeout GSource twice in dispose
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] [EActivityBar] Do not remove timeout GSource twice in dispose
- Date: Tue, 10 Nov 2015 17:46:36 +0000 (UTC)
commit 9f759aa20d3c5c1aaab455b2b96f87ebfeac4250
Author: Milan Crha <mcrha redhat com>
Date: Tue Nov 10 18:40:59 2015 +0100
[EActivityBar] Do not remove timeout GSource twice in dispose
When the window holding the activity bar is closed, the widget itself
has run dispose. it's possible that the timeout source holds the last
reference to the widget, thus when the GSource is removed, it also
unreferences the widget, which calls the dispose again and it is
tried again to remove the same GSource. using a temporary variable
and setting the private variable to zero before the removal fixes
the critical warning which this double-remove causes.
e-util/e-activity-bar.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/e-util/e-activity-bar.c b/e-util/e-activity-bar.c
index d601e76..62f205f 100644
--- a/e-util/e-activity-bar.c
+++ b/e-util/e-activity-bar.c
@@ -254,8 +254,10 @@ activity_bar_dispose (GObject *object)
priv = E_ACTIVITY_BAR_GET_PRIVATE (object);
if (priv->timeout_id > 0) {
- g_source_remove (priv->timeout_id);
+ guint timeout_id = priv->timeout_id;
+
priv->timeout_id = 0;
+ g_source_remove (timeout_id);
}
if (priv->activity != NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]