mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-06 05:58:24 +02:00
wplua: ref closure before invalidating it
invalidation may destroy the closure and this will trigger _wplua_closure_finalize(), which will remove the closure from the array while the original code is also trying to do the same if we destroy the closure after it has been removed from the array, _wplua_closure_finalize() will not remove anything and will continue happily
This commit is contained in:
parent
ac23e60267
commit
4e3ca5dc15
1 changed files with 2 additions and 0 deletions
|
|
@ -33,8 +33,10 @@ _wplua_closure_store_finalize (WpLuaClosureStore * self)
|
|||
{
|
||||
for (guint i = self->closures->len; i > 0; i--) {
|
||||
GClosure *c = g_ptr_array_index (self->closures, i-1);
|
||||
g_closure_ref (c);
|
||||
g_closure_invalidate (c);
|
||||
g_ptr_array_remove_index_fast (self->closures, i-1);
|
||||
g_closure_unref (c);
|
||||
}
|
||||
g_ptr_array_unref (self->closures);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue