diff options
author | Ted Gould <ted@gould.cx> | 2010-06-17 22:16:01 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-06-17 22:16:01 -0500 |
commit | ce25d4c9ac44237bb1f38576e99de3533489bd74 (patch) | |
tree | 4d55d38b6c4f27d7998d42a08c46ded6c870f5cd /src | |
parent | e589ecaddf4d14e9aeea5aed9f4076b1447cc926 (diff) | |
download | libayatana-appindicator-ce25d4c9ac44237bb1f38576e99de3533489bd74.tar.gz libayatana-appindicator-ce25d4c9ac44237bb1f38576e99de3533489bd74.tar.bz2 libayatana-appindicator-ce25d4c9ac44237bb1f38576e99de3533489bd74.zip |
Use class ref and unref to allocate it if need be.
Diffstat (limited to 'src')
-rw-r--r-- | src/application-service-appstore.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index c18ebe2..66e3cf3 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -243,13 +243,17 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err static AppIndicatorStatus string_to_status(const gchar * status_string) { - GEnumClass * klass = G_ENUM_CLASS(g_type_class_peek_static(APP_INDICATOR_TYPE_INDICATOR_STATUS)); + GEnumClass * klass = G_ENUM_CLASS(g_type_class_ref(APP_INDICATOR_TYPE_INDICATOR_STATUS)); g_return_val_if_fail(klass != NULL, APP_INDICATOR_STATUS_PASSIVE); GEnumValue * val = g_enum_get_value_by_nick(klass, status_string); g_return_val_if_fail(val != NULL, APP_INDICATOR_STATUS_PASSIVE); - return (AppIndicatorStatus)val->value; + AppIndicatorStatus retval = (AppIndicatorStatus)val->value; + + g_type_class_unref(klass); + + return retval; } /* A small helper function to get the position of an application |