diff options
author | Ted Gould <ted@gould.cx> | 2010-02-06 11:43:18 -0800 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-06 11:43:18 -0800 |
commit | ffbe6e8e06ac6c0b536cb14f78c9d6c57bfa4786 (patch) | |
tree | a1600ec738d66e83b308a96ca8c21a3eea9bd443 /src | |
parent | aca327039de27681ae3986f79749f8fe7c5ecd73 (diff) | |
download | ayatana-indicator-application-ffbe6e8e06ac6c0b536cb14f78c9d6c57bfa4786.tar.gz ayatana-indicator-application-ffbe6e8e06ac6c0b536cb14f78c9d6c57bfa4786.tar.bz2 ayatana-indicator-application-ffbe6e8e06ac6c0b536cb14f78c9d6c57bfa4786.zip |
Adding check to look for privates gotten on invalid objects.
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-application.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c index ce83d17..e84681a 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -224,6 +224,7 @@ indicator_application_finalize (GObject *object) void connection_changed (IndicatorServiceManager * sm, gboolean connect, IndicatorApplication * application) { + g_return_if_fail(IS_INDICATOR_APPLICATION(application)); if (connect) { connected(application); } else { @@ -315,7 +316,7 @@ static void disconnected (IndicatorApplication * application) { IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); - g_list_foreach(priv->applications, disconnected_helper, NULL); + g_list_foreach(priv->applications, disconnected_helper, application); /* I'll like this to be a little shorter, but it's a bit inpractical to make it so. This means that the user will probably notice a visible glitch. Though, if applications @@ -338,9 +339,10 @@ disconnected_helper (gpointer data, gpointer user_data) static gboolean disconnected_kill (gpointer user_data) { + g_return_val_if_fail(IS_INDICATOR_APPLICATION(user_data), FALSE); IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(user_data); priv->disconnect_kill = 0; - g_list_foreach(priv->applications, disconnected_kill_helper, NULL); + g_list_foreach(priv->applications, disconnected_kill_helper, user_data); return FALSE; } @@ -349,6 +351,7 @@ disconnected_kill (gpointer user_data) static void disconnected_kill_helper (gpointer data, gpointer user_data) { + g_return_if_fail(IS_INDICATOR_APPLICATION(user_data)); IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(user_data); ApplicationEntry * entry = (ApplicationEntry *)data; if (entry->old_service) { @@ -412,6 +415,7 @@ application_added_search (gconstpointer a, gconstpointer b) static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_path, IndicatorApplication * application) { + g_return_if_fail(IS_INDICATOR_APPLICATION(application)); g_debug("Building new application entry: %s with icon: %s", dbusaddress, iconname); IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); @@ -472,6 +476,7 @@ application_added (DBusGProxy * proxy, const gchar * iconname, gint position, co static void application_removed (DBusGProxy * proxy, gint position, IndicatorApplication * application) { + g_return_if_fail(IS_INDICATOR_APPLICATION(application)); IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); ApplicationEntry * app = (ApplicationEntry *)g_list_nth_data(priv->applications, position); |