diff options
author | David Zeuthen <david@fubar.dk> | 2005-02-28 04:53:15 +0000 |
---|---|---|
committer | David Zeuthen <david@fubar.dk> | 2005-02-28 04:53:15 +0000 |
commit | a58012bd263a23d91e9c3e972bf0a89f4a0b49d8 (patch) | |
tree | c44bd1808770269157c92073fb4469cecb317e21 /hald/linux2/blockdev.c | |
parent | 2d911a3754d736567dfab37fbeedb085965137a9 (diff) |
More fun with valgrind :-)
Fix a bunch of leaks by calling g_object_unref for HalDevice objects that
goes away
Fix a bunch of leaks by calling g_object_unref for HalDevice objects that
goes away
Don't leak parent_path
New function; to free values of the sysfs_to_class_in_devices_map hashtable
(coldplug_synthesize_events): Fix memory leaks
Fix a bunch of leaks by calling g_object_unref for HalDevice objects that
goes away
Don't leak old value
Fixup error handling (device_property_atomic_update_end): Fix memory leak
Add HALD_MEMLEAK_DBG but uncomment it by default
New function, defined only if HALD_MEMLEAK_DBG is set; should prolly be
invoked by handler registered with atexit(3); some day in the future
(osspec_probe_done): Add appropriate timeout if HALD_MEMLEAK_DBG is et
Recognize the HALD_MEMLEAK_DBG define and maintain
dbg_hal_device_object_delta accordingly. (hal_device_set_udi): Don't
leak old udi
New file - useful for finding memory leaks
Diffstat (limited to 'hald/linux2/blockdev.c')
-rw-r--r-- | hald/linux2/blockdev.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hald/linux2/blockdev.c b/hald/linux2/blockdev.c index c40488b8..6bac6727 100644 --- a/hald/linux2/blockdev.c +++ b/hald/linux2/blockdev.c @@ -148,6 +148,7 @@ blockdev_callouts_remove_done (HalDevice *d, gpointer userdata1, gpointer userda if (!hal_device_store_remove (hald_get_gdl (), d)) { HAL_WARNING (("Error removing device")); } + g_object_unref (d); hotplug_event_end (end_token); } @@ -272,12 +273,14 @@ add_blockdev_probing_helper_done (HalDevice *d, gboolean timed_out, gint return_ */ if (timed_out || !(return_code == 0 || (!is_volume && return_code == 2))) { hal_device_store_remove (hald_get_tdl (), d); + g_object_unref (d); hotplug_event_end (end_token); goto out; } if (!blockdev_compute_udi (d)) { hal_device_store_remove (hald_get_tdl (), d); + g_object_unref (d); hotplug_event_end (end_token); goto out; } @@ -350,6 +353,7 @@ blockdev_callouts_preprobing_storage_done (HalDevice *d, gpointer userdata1, gpo NULL, add_blockdev_probing_helper_done, HAL_HELPER_TIMEOUT) == NULL) { hal_device_store_remove (hald_get_tdl (), d); + g_object_unref (d); hotplug_event_end (end_token); } goto out; @@ -377,6 +381,7 @@ blockdev_callouts_preprobing_storage_done (HalDevice *d, gpointer userdata1, gpo NULL, add_blockdev_probing_helper_done, HAL_HELPER_TIMEOUT) == NULL) { hal_device_store_remove (hald_get_tdl (), d); + g_object_unref (d); hotplug_event_end (end_token); } @@ -413,6 +418,7 @@ blockdev_callouts_preprobing_volume_done (HalDevice *d, gpointer userdata1, gpoi NULL, add_blockdev_probing_helper_done, HAL_HELPER_TIMEOUT) == NULL) { hal_device_store_remove (hald_get_tdl (), d); + g_object_unref (d); hotplug_event_end (end_token); } @@ -473,7 +479,7 @@ hotplug_event_begin_add_blockdev (const gchar *sysfs_path, const gchar *device_f if (!is_fakevolume && hal_device_property_get_bool (parent, "storage.no_partitions_hint")) { HAL_INFO (("Ignoring blockdev since not a fakevolume and parent has " "storage.no_partitions_hint==TRUE")); - goto out; + goto error; } } |