diff options
author | Ryan Lortie <desrt@desrt.ca> | 2012-07-02 23:34:43 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2012-07-02 23:34:43 -0400 |
commit | cc3221d143889375683a63ed888d984fe8aabe9a (patch) | |
tree | 70b6ed4fa7088a1061d3b4348dbc79772df1d451 /engine/dconf-engine.h | |
parent | 4eea8cb823c5a113d8209b04102f17f08df853d6 (diff) | |
download | dconf-cc3221d143889375683a63ed888d984fe8aabe9a.tar.gz |
Implement change signals
Support receiving and properly exposing change notifications.
This required some changes to improve the thread-safety of destroying a
DConfEngine.
It is possible that a signal would be arriving (in the worker thread) at
the exact instant that a DConfEngine was being destroyed (from the
finalize of the DConfClient or DConfSettingsBackend). This could lead
to the object being accessed after it was finalized.
We can avoid this by using weak references and by being more careful
about when the DConfEngine is freed (by taking a ref to it in the signal
handler and releasing it when done).
Diffstat (limited to 'engine/dconf-engine.h')
-rw-r--r-- | engine/dconf-engine.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engine/dconf-engine.h b/engine/dconf-engine.h index 19b7097..bad8cf1 100644 --- a/engine/dconf-engine.h +++ b/engine/dconf-engine.h @@ -100,10 +100,11 @@ void dconf_engine_handle_dbus_signal (GBusTyp GVariant *parameters); G_GNUC_INTERNAL -DConfEngine * dconf_engine_new (gpointer user_data); +DConfEngine * dconf_engine_new (gpointer user_data, + GDestroyNotify free_func); G_GNUC_INTERNAL -void dconf_engine_free (DConfEngine *engine); +void dconf_engine_unref (DConfEngine *engine); /* Read API: always handled immediately */ G_GNUC_INTERNAL |