ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #01732
[Branch ~indicator-applet-developers/indicator-me/trunk] Rev 96: merging in a fix for a leak with the ido entry whenever the connection changes
Merge authors:
Cody Russell (bratsche)
Related merge proposals:
https://code.launchpad.net/~bratsche/indicator-me/fix-restarting-service/+merge/22573
proposed by: Cody Russell (bratsche)
review: Approve - David Barth (dbarth)
review: Approve - Ted Gould (ted)
------------------------------------------------------------
revno: 96 [merge]
committer: David Barth <david.barth@xxxxxxxxxxxxx>
branch nick: indicator-me
timestamp: Thu 2010-06-24 19:13:16 +0200
message:
merging in a fix for a leak with the ido entry whenever the connection changes
modified:
src/indicator-me.c
--
lp:indicator-me
https://code.launchpad.net/~indicator-applet-developers/indicator-me/trunk
Your team ayatana-commits is subscribed to branch lp:indicator-me.
To unsubscribe from this branch go to https://code.launchpad.net/~indicator-applet-developers/indicator-me/trunk/+edit-subscription
=== modified file 'src/indicator-me.c'
--- src/indicator-me.c 2010-03-24 09:38:22 +0000
+++ src/indicator-me.c 2010-03-31 22:07:27 +0000
@@ -74,6 +74,8 @@
static GtkLabel *label = NULL;
static DBusGProxy * status_proxy = NULL;
+static IdoEntryMenuItem *ido_entry = NULL;
+
/* Prototypes */
static GtkLabel * get_label (IndicatorObject * io);
static GtkImage * get_icon (IndicatorObject * io);
@@ -85,6 +87,9 @@
static void indicator_me_finalize (GObject *object);
static void connection_changed (IndicatorServiceManager * sm, gboolean connected, gpointer userdata);
static void status_icon_cb (DBusGProxy * proxy, char * icons, GError *error, gpointer userdata);
+static gboolean new_entry_item (DbusmenuMenuitem * newitem,
+ DbusmenuMenuitem * parent,
+ DbusmenuClient * client);
G_DEFINE_TYPE (IndicatorMe, indicator_me, INDICATOR_OBJECT_TYPE);
@@ -232,10 +237,17 @@
/* query the service for the username to display */
org_ayatana_indicator_me_service_pretty_user_name_async(status_proxy, username_cb, NULL);
-
} else {
/* If we're disconnecting, go back to offline */
status_icon_cb(NULL, DEFAULT_ICON, NULL, NULL);
+
+ g_object_unref (status_proxy);
+ status_proxy = NULL;
+
+ if (ido_entry != NULL) {
+ g_object_unref (ido_entry);
+ ido_entry = NULL;
+ }
}
return;
@@ -305,6 +317,8 @@
gtk_entry_set_width_chars (entry, 23); /* set some nice aspect ratio for the menu */
gtk_entry_set_max_length (entry, 140); /* enforce current gwibber limit */
+ ido_entry = ido;
+
g_signal_connect (ido,
"notify::parent", G_CALLBACK (entry_parent_changed),
NULL);