diff --git a/src/pipewire/core.c b/src/pipewire/core.c index 48931a017..2fe0eb79e 100644 --- a/src/pipewire/core.c +++ b/src/pipewire/core.c @@ -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);