mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-04 04:56:52 +02:00
binding: Use hash table as a set
This commit is contained in:
parent
25a3c8720c
commit
d1959e4faa
@ -210,10 +210,10 @@ add_binding_qdata (GObject *gobject,
|
|||||||
|
|
||||||
g_object_set_qdata_full (gobject, quark_gbinding,
|
g_object_set_qdata_full (gobject, quark_gbinding,
|
||||||
bindings,
|
bindings,
|
||||||
(GDestroyNotify) g_hash_table_destroy);
|
(GDestroyNotify) g_hash_table_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_hash_table_insert (bindings, binding, GUINT_TO_POINTER (1));
|
g_hash_table_add (bindings, binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
@ -223,6 +223,7 @@ remove_binding_qdata (GObject *gobject,
|
|||||||
GHashTable *bindings;
|
GHashTable *bindings;
|
||||||
|
|
||||||
bindings = g_object_get_qdata (gobject, quark_gbinding);
|
bindings = g_object_get_qdata (gobject, quark_gbinding);
|
||||||
|
if (binding != NULL)
|
||||||
g_hash_table_remove (bindings, binding);
|
g_hash_table_remove (bindings, binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user