[RFC PATCH 1/3] talloc_set_destructor workaround
Samuel Mendoza-Jonas
sam.mj at au1.ibm.com
Mon Apr 27 15:52:47 AEST 2015
Temporary fix to work around the fact that the destructor set in
discover_device_create() never gets called when handler->devices are
freed.
Signed-off-by: Samuel Mendoza-Jonas <sam.mj at au1.ibm.com>
---
discover/device-handler.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/discover/device-handler.c b/discover/device-handler.c
index f053713..f411d9f 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -335,6 +335,10 @@ void device_handler_reinit(struct device_handler *handler)
discover_server_notify_device_remove(handler->server,
handler->devices[i]->device);
+ /* FIXME: Until i figure out why the destructor isn't getting called: */
+ for (i = 0; i < handler->n_devices; i++)
+ umount_device(handler->devices[i]);
+ pb_log("%s: freeing devices\n", __func__);
talloc_free(handler->devices);
handler->devices = NULL;
handler->n_devices = 0;
--
2.1.0
More information about the Petitboot
mailing list