aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-06-02 16:57:35 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-06-02 16:57:35 +0200
commita6d889c175d136cfb1d63a9c04bb2156f210a09e (patch)
treeab7d4a21effedb56f96a1706755c8b79104f74e8
parent7989e5c7bb1e012d3703716bfd54e20586bd412c (diff)
downloadayatana-indicator-messages-a6d889c175d136cfb1d63a9c04bb2156f210a09e.tar.gz
ayatana-indicator-messages-a6d889c175d136cfb1d63a9c04bb2156f210a09e.tar.bz2
ayatana-indicator-messages-a6d889c175d136cfb1d63a9c04bb2156f210a09e.zip
app-section: only call g_bus_unwatch_name if we're watching a name
-rw-r--r--src/app-section.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/app-section.c b/src/app-section.c
index 9a905bc..6218f37 100644
--- a/src/app-section.c
+++ b/src/app-section.c
@@ -370,7 +370,7 @@ app_section_set_object_path (AppSection *self,
{
AppSectionPrivate *priv = APP_SECTION_GET_PRIVATE (self);
- if (priv->remote_menu)
+ if (priv->name_watch_id)
g_bus_unwatch_name (priv->name_watch_id);
g_clear_object (&priv->actions);
g_clear_object (&priv->remote_menu);
@@ -396,8 +396,10 @@ app_section_unset_object_path (AppSection *self)
{
AppSectionPrivate *priv = APP_SECTION_GET_PRIVATE (self);
- if (priv->remote_menu)
+ if (priv->name_watch_id) {
g_bus_unwatch_name (priv->name_watch_id);
+ priv->name_watch_id = 0;
+ }
g_clear_object (&priv->actions);
g_clear_object (&priv->remote_menu);
}