mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 15:00:10 +01:00
glib-aux: add nm_auto_pop_and_unref_gmaincontext cleanup macro
This commit is contained in:
parent
071ef784cf
commit
8a11380e80
1 changed files with 12 additions and 0 deletions
|
|
@ -1564,6 +1564,18 @@ NM_AUTO_DEFINE_FCN0(GSource *, _nm_auto_destroy_and_unref_gsource, nm_g_source_d
|
|||
NM_AUTO_DEFINE_FCN0(GMainContext *, _nm_auto_pop_gmaincontext, g_main_context_pop_thread_default);
|
||||
#define nm_auto_pop_gmaincontext nm_auto(_nm_auto_pop_gmaincontext)
|
||||
|
||||
static inline void
|
||||
nm_g_main_context_pop_and_unref(GMainContext *context)
|
||||
{
|
||||
g_main_context_pop_thread_default(context);
|
||||
g_main_context_unref(context);
|
||||
}
|
||||
|
||||
NM_AUTO_DEFINE_FCN0(GMainContext *,
|
||||
_nm_auto_pop_and_unref_gmaincontext,
|
||||
nm_g_main_context_pop_and_unref);
|
||||
#define nm_auto_pop_and_unref_gmaincontext nm_auto(_nm_auto_pop_and_unref_gmaincontext)
|
||||
|
||||
static inline gboolean
|
||||
nm_source_func_unref_gobject(gpointer user_data)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue