[vino] Fix two memory leaks



commit c0ef037eb7768feea53ba6fd2afb8f39cbc4bef8
Author: Eric R. Schulz <eric ers35 com>
Date:   Thu Aug 18 10:02:28 2016 -0400

    Fix two memory leaks
    
    Unref builder in server_connected_changed_cb() and free tooltip in
    vino_status_icon_update_state().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770091

 server/vino-dbus-listener.c |    1 +
 server/vino-status-icon.c   |    7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/server/vino-dbus-listener.c b/server/vino-dbus-listener.c
index d1c57c8..5d59528 100644
--- a/server/vino-dbus-listener.c
+++ b/server/vino-dbus-listener.c
@@ -233,6 +233,7 @@ server_connected_changed_cb (GObject    *gobject,
                                                 builder,
                                                 NULL),
                                  NULL);
+  g_variant_builder_unref (builder);
 }
 
 void
diff --git a/server/vino-status-icon.c b/server/vino-status-icon.c
index aaab0af..74900e9 100644
--- a/server/vino-status-icon.c
+++ b/server/vino-status-icon.c
@@ -94,8 +94,6 @@ vino_status_icon_update_state (VinoStatusIcon *icon)
 
   visible = !vino_server_get_on_hold (icon->priv->server);
 
-  tooltip = g_strdup (_("Desktop sharing is enabled"));
-  
   if (icon->priv->clients != NULL)
     {
       int n_clients;
@@ -110,7 +108,10 @@ vino_status_icon_update_state (VinoStatusIcon *icon)
                             (icon->priv->visibility == VINO_STATUS_ICON_VISIBILITY_ALWAYS) );
     }
   else
-    visible = visible && (icon->priv->visibility == VINO_STATUS_ICON_VISIBILITY_ALWAYS);
+    {
+      tooltip = g_strdup (_("Desktop sharing is enabled"));
+      visible = visible && (icon->priv->visibility == VINO_STATUS_ICON_VISIBILITY_ALWAYS);
+    }
 
   gtk_status_icon_set_tooltip_text (GTK_STATUS_ICON (icon), tooltip);
   gtk_status_icon_set_visible (GTK_STATUS_ICON (icon), visible);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]