mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
plugins: Fix undefined deallocation order in struct plugins
We use the new function `plugins_free` to define the correct deallocation order on shutdown, since under normal operation the allocation tree is organized to allow plugins to terminate and automatically free all dependent resources. During shutdown the deallocation order is under-defined since siblings may get freed in any order, but we implicitly rely on them staying around.
This commit is contained in:
committed by
Rusty Russell
parent
284bd7de0c
commit
27ea47ae37
@@ -997,7 +997,7 @@ int main(int argc, char *argv[])
|
||||
shutdown_subdaemons(ld);
|
||||
|
||||
/* Remove plugins. */
|
||||
ld->plugins = tal_free(ld->plugins);
|
||||
plugins_free(ld->plugins);
|
||||
|
||||
/* Clean up the JSON-RPC. This needs to happen in a DB transaction since
|
||||
* it might actually be touching the DB in some destructors, e.g.,
|
||||
|
||||
Reference in New Issue
Block a user