diff options
author | Jasmine Hassan <[email protected]> | 2012-10-29 04:21:19 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-12-22 05:21:53 +0200 |
commit | ab206cf53ff4380c63f031101c36b6bc0c7a8489 (patch) | |
tree | 7fcbd3920c3b55f3054238b395fef4f116bd6542 /src/caja-places-sidebar.c | |
parent | f5f249b7e2bb2206222ce5d0ae4ed95d8e99b8c2 (diff) | |
download | caja-ab206cf53ff4380c63f031101c36b6bc0c7a8489.tar.bz2 caja-ab206cf53ff4380c63f031101c36b6bc0c7a8489.tar.xz |
[places-sidebar] plug leak in _dispose, add g_clear_object in glibcomat.h
to cleanup code a bit.
http://git.gnome.org/browse/nautilus/commit/?id=c6fa6b2062a1adf3e4945824048b3771edb35ebe
for g_clear_object compatibility:
https://gitorious.org/vaapi/gstreamer-vaapi/commit/ab2ec5e2541834c2490a78ec839850df2b075cf5?format=diff
Diffstat (limited to 'src/caja-places-sidebar.c')
-rw-r--r-- | src/caja-places-sidebar.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c index fa588663..88e7d1c1 100644 --- a/src/caja-places-sidebar.c +++ b/src/caja-places-sidebar.c @@ -53,7 +53,7 @@ #include "caja-places-sidebar.h" #include "caja-window.h" -#include "glibcompat.h" /* for g_list_free_full */ +#include "glibcompat.h" /* for g_list_free_full and g_clear_object */ #define EJECT_BUTTON_XPAD 6 #define ICON_CELL_XPAD 6 @@ -3332,20 +3332,10 @@ caja_places_sidebar_dispose (GObject *object) sidebar->eject_highlight_path = NULL; } - if (sidebar->store != NULL) { - g_object_unref (sidebar->store); - sidebar->store = NULL; - } - - if (sidebar->volume_monitor != NULL) { - g_object_unref (sidebar->volume_monitor); - sidebar->volume_monitor = NULL; - } - - if (sidebar->bookmarks != NULL) { - g_object_unref (sidebar->bookmarks); - sidebar->bookmarks = NULL; - } + g_clear_object (&sidebar->store); + g_clear_object (&sidebar->volume_monitor); + g_clear_object (&sidebar->bookmarks); + g_clear_object (&sidebar->filter_model); eel_remove_weak_pointer (&(sidebar->go_to_after_mount_slot)); |