mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-06 16:09:43 +00:00
pipewire: core: static assert member order requirement
The pw_proxy member of pw_core must be the first because the pw_core object is freed via pw_proxy_destroy() -> pw_proxy_unref().
This commit is contained in:
parent
4bec3b56d4
commit
0e823d8a0f
|
@ -476,6 +476,12 @@ struct pw_mempool * pw_core_get_mempool(struct pw_core *core)
|
|||
SPA_EXPORT
|
||||
int pw_core_disconnect(struct pw_core *core)
|
||||
{
|
||||
/*
|
||||
* the `proxy` member must be the first because the whole pw_core object is
|
||||
* freed via the free() call in pw_proxy_destroy() -> pw_proxy_unref()
|
||||
*/
|
||||
SPA_STATIC_ASSERT(offsetof(struct pw_core, proxy) == 0, "`proxy` member must be first");
|
||||
|
||||
pw_log_debug("%p: disconnect", core);
|
||||
if (!core->removed)
|
||||
pw_proxy_remove(&core->proxy);
|
||||
|
|
Loading…
Reference in a new issue