diff options
author | Mike Gorse <mgorse@suse.com> | 2014-07-19 15:42:52 -0500 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2014-07-19 15:42:52 -0500 |
commit | 95a025d4468d4841f67f443edb459fd8dec53036 (patch) | |
tree | bd23dd8b9d0bb8428de26c9ebba5c41f7a0b545e | |
parent | 4c0da161e7af297b34ca7fc31bd44c12baf78636 (diff) | |
download | at-spi2-core-95a025d4468d4841f67f443edb459fd8dec53036.tar.gz |
Unref enum type classes when we're done with them
-rw-r--r-- | atspi/atspi-misc.c | 2 | ||||
-rw-r--r-- | atspi/atspi-stateset.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c index aa2fb66e..0492b3f8 100644 --- a/atspi/atspi-misc.c +++ b/atspi/atspi-misc.c @@ -1697,6 +1697,8 @@ atspi_role_get_name (AtspiRole role) retval = g_strdup (value->value_nick); } + g_type_class_unref (type_class); + if (retval) return _atspi_name_compat (retval); diff --git a/atspi/atspi-stateset.c b/atspi/atspi-stateset.c index 33c28a7f..1f9d9931 100644 --- a/atspi/atspi-stateset.c +++ b/atspi/atspi-stateset.c @@ -90,13 +90,14 @@ atspi_state_set_set_by_name (AtspiStateSet *set, const gchar *name, gboolean ena GTypeClass *type_class; GEnumValue *value; - type_class = g_type_class_ref (ATSPI_TYPE_STATE_TYPE); - if (set->accessible && !(set->accessible->cached_properties & ATSPI_CACHE_STATES)) return; + type_class = g_type_class_ref (ATSPI_TYPE_STATE_TYPE); + value = g_enum_get_value_by_nick (G_ENUM_CLASS (type_class), name); + if (!value) { g_warning ("AT-SPI: Attempt to set unknown state '%s'", name); @@ -106,6 +107,8 @@ atspi_state_set_set_by_name (AtspiStateSet *set, const gchar *name, gboolean ena set->states |= ((gint64)1 << value->value); else set->states &= ~((gint64)1 << value->value); + + g_type_class_unref (type_class); } static void |