[evolution/wip/webkit2] [EActivityBar] Do not remove timeout GSource twice in dispose
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] [EActivityBar] Do not remove timeout GSource twice in dispose
- Date: Wed, 2 Mar 2016 15:20:02 +0000 (UTC)
commit 82d0c043e7a5bf2a1fad3bb8f1c3fa292e601793
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]