mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 13:00:16 +01:00
libnm: fix assertion in NMClient checking for current main context
NMClient is strongly tied to the GMainContext with which it was created.
Several operations must only be called from within the context. There
was an assertion for that.
However, creating (and init_async()) should be allowed to call not
from within the GMainContext. So if the current context has no owner
(is not acquired), then it's also OK.
Fix the assertion for that.
Fixes: ce0e898fb4 ('libnm: refactor caching of D-Bus objects in NMClient')
This commit is contained in:
parent
5dc9307a34
commit
ae0cc9618c
1 changed files with 2 additions and 2 deletions
|
|
@ -764,7 +764,7 @@ _nm_client_set_property_sync_legacy(NMClient *self,
|
|||
NMClientPrivate *_priv = NM_CLIENT_GET_PRIVATE(self); \
|
||||
\
|
||||
nm_assert(g_source_get_context(_source) == _priv->x_context); \
|
||||
nm_assert(g_main_context_is_owner(_priv->x_context)); \
|
||||
nm_assert(nm_g_main_context_can_acquire(_priv->x_context)); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
|
|
@ -778,7 +778,7 @@ _nm_client_set_property_sync_legacy(NMClient *self,
|
|||
\
|
||||
nm_assert((g_main_context_get_thread_default() ?: g_main_context_default()) \
|
||||
== _priv->x_context); \
|
||||
nm_assert(g_main_context_is_owner(_priv->x_context)); \
|
||||
nm_assert(nm_g_main_context_can_acquire(_priv->x_context)); \
|
||||
} \
|
||||
} \
|
||||
G_STMT_END
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue