summaryrefslogtreecommitdiff
path: root/libnautilus/nautilus-undo.c
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-09-06 17:08:09 +0000
committerDarin Adler <darin@src.gnome.org>2000-09-06 17:08:09 +0000
commit307bafbb3ff58a1c927ce89a783d04d01278639c (patch)
treede18ba9fdf2532834ca4a3ccd86dc2841242cabb /libnautilus/nautilus-undo.c
parentc9ec59f155800c722fe95d2269491873b4f28b8a (diff)
downloadnautilus-307bafbb3ff58a1c927ce89a783d04d01278639c.tar.gz
Added checks in Nautilus to guarantee we will notice leaks
of UI handlers in the future. The check will fire unless you get new Bonobo, since I just fixed a UI handler leak bug in Bonobo. * src/nautilus-window.c: (nautilus_window_real_set_content_view): Added code to check for a still-merged Open menu item in the file menu. This will catch leaks of UI handlers fairly quickly, instead of the traditional way we discover them, after long debugging sessions. * components/history/nautilus-history-view.c: (history_view_frame_call_end): * libnautilus-extensions/nautilus-undo-manager.c: (release_transaction), (nautilus_undo_manager_undo): * libnautilus/nautilus-clipboard.c: (add_menu_items_callback): * libnautilus/nautilus-undo.c: (undo_manager_unref_cover), (nautilus_undo_attach_undo_manager): * libnautilus/nautilus-view.c: (view_frame_call_end): * src/file-manager/fm-directory-view.c: (bonobo_control_activate_callback): * src/nautilus-application.c: (nautilus_application_startup): * src/nautilus-view-frame-bonobo-embeddable.c: (bonobo_subdoc_load_location): * src/nautilus-view-frame-nautilus-view.c: (nautilus_view_try_load_client): * src/nautilus-view-frame.c: (nautilus_view_frame_destroy_client), (nautilus_view_frame_load_client): Use bonobo_object_dup_ref and bonobo_object_release_unref to simplify some code. * components/loser/content/nautilus-content-loser.c: (loser_merge_bonobo_items_callback): * components/loser/sidebar/nautilus-sidebar-loser.c: (loser_merge_bonobo_items_callback): * components/mozilla/nautilus-mozilla-content-view.c: (mozilla_merge_bonobo_items_callback): * components/sample/nautilus-sample-content-view.c: (sample_merge_bonobo_items_callback): Add missing unref to avoid leaking a UI handler. * components/services/time/nautilus-view/trilobite-eazel-time-view.c: Remove a bunch of code inside #if 0, which had out of date copies of the sample code. I decided this was better than trying to fix it.
Diffstat (limited to 'libnautilus/nautilus-undo.c')
-rw-r--r--libnautilus/nautilus-undo.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/libnautilus/nautilus-undo.c b/libnautilus/nautilus-undo.c
index eaf7d2bc0..66f3b91bf 100644
--- a/libnautilus/nautilus-undo.c
+++ b/libnautilus/nautilus-undo.c
@@ -190,35 +190,10 @@ nautilus_undo_get_undo_manager (GtkObject *start_object)
return CORBA_OBJECT_NIL;
}
-static Nautilus_Undo_Manager
-undo_manager_ref (Nautilus_Undo_Manager manager)
-{
- CORBA_Environment ev;
- Nautilus_Undo_Manager result;
-
- CORBA_exception_init (&ev);
- Nautilus_Undo_Manager_ref (manager, &ev);
- result = CORBA_Object_duplicate (manager, &ev);
- CORBA_exception_free (&ev);
-
- return result;
-}
-
-static void
-undo_manager_unref (Nautilus_Undo_Manager manager)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
- Nautilus_Undo_Manager_unref (manager, &ev);
- CORBA_Object_release (manager, &ev);
- CORBA_exception_free (&ev);
-}
-
static void
undo_manager_unref_cover (gpointer manager)
{
- undo_manager_unref (manager);
+ bonobo_object_release_unref (manager, NULL);
}
void
@@ -230,9 +205,10 @@ nautilus_undo_attach_undo_manager (GtkObject *object,
if (manager == NULL) {
gtk_object_remove_data (object, NAUTILUS_UNDO_MANAGER_DATA);
} else {
+ bonobo_object_dup_ref (manager, NULL);
gtk_object_set_data_full
(object, NAUTILUS_UNDO_MANAGER_DATA,
- undo_manager_ref (manager), undo_manager_unref_cover);
+ manager, undo_manager_unref_cover);
}
}