Commit 90166bac authored by Darin Adler's avatar Darin Adler
Browse files

Fixed some leaks that cause problems with the new Bonobo.

	* components/history/nautilus-history-view.c:
	(history_view_frame_call_end):
	* libnautilus/nautilus-undo.c: (set_up_bonobo_control):
	* libnautilus/nautilus-view.c: (view_frame_call_end):
	* libnautilus/nautilus-zoomable.c:
	(nautilus_zoomable_ensure_zoomable_frame):
	Fixed a ref. count leak by adding code to unref the result of
	query_interface.

	* src/nautilus-view-frame.c: (nautilus_view_frame_is_zoomable):
	Fixed logic that was backwards.
parent fedba731
2000-07-11 Darin Adler <darin@eazel.com>
Fixed some leaks that cause problems with the new Bonobo.
* components/history/nautilus-history-view.c:
(history_view_frame_call_end):
* libnautilus/nautilus-undo.c: (set_up_bonobo_control):
* libnautilus/nautilus-view.c: (view_frame_call_end):
* libnautilus/nautilus-zoomable.c:
(nautilus_zoomable_ensure_zoomable_frame):
Fixed a ref. count leak by adding code to unref the result of
query_interface.
* src/nautilus-view-frame.c: (nautilus_view_frame_is_zoomable):
Fixed logic that was backwards.
2000-07-11 Andy Hertzfeld <andy@eazel.com>
* src/nautilus-window.c: (nautilus_window_realize):
......
......@@ -76,6 +76,7 @@ history_view_frame_call_begin (NautilusView *view, CORBA_Environment *ev)
static void
history_view_frame_call_end (Nautilus_HistoryFrame frame, CORBA_Environment *ev)
{
Nautilus_HistoryFrame_unref (frame, ev);
CORBA_Object_release (frame, ev);
CORBA_exception_free (ev);
}
......
......@@ -281,6 +281,7 @@ set_up_bonobo_control (BonoboControl *control)
(control_frame, "IDL:Nautilus/Undo/Context:1.0", &ev);
if (!CORBA_Object_is_nil (undo_context, &ev)) {
manager = Nautilus_Undo_Context__get_undo_manager (undo_context, &ev);
Bonobo_Control_unref (undo_context, &ev);
}
CORBA_Object_release (undo_context, &ev);
}
......
......@@ -293,6 +293,7 @@ view_frame_call_begin (NautilusView *view, CORBA_Environment *ev)
static void
view_frame_call_end (Nautilus_ViewFrame frame, CORBA_Environment *ev)
{
Nautilus_ViewFrame_unref (frame, ev);
CORBA_Object_release (frame, ev);
CORBA_exception_free (ev);
}
......
......@@ -511,19 +511,22 @@ nautilus_zoomable_ensure_zoomable_frame (NautilusZoomable *view)
(bonobo_control_get_control_frame
(BONOBO_CONTROL (nautilus_zoomable_get_bonobo_control (view))),
"IDL:Nautilus/ZoomableFrame:1.0", &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
view->details->zoomable_frame = CORBA_OBJECT_NIL;
}
if (CORBA_Object_is_nil (view->details->zoomable_frame, &ev)) {
view->details->zoomable_frame = CORBA_OBJECT_NIL;
}
/* Don't keep a ref to the frame, because that would be circular. */
if (view->details->zoomable_frame != CORBA_OBJECT_NIL) {
Bonobo_Unknown_unref (view->details->zoomable_frame, &ev);
}
}
if (ev._major != CORBA_NO_EXCEPTION) {
view->details->zoomable_frame = CORBA_OBJECT_NIL;
}
if (CORBA_Object_is_nil (view->details->zoomable_frame, &ev)) {
CORBA_exception_free (&ev);
return FALSE;
} else {
CORBA_exception_free (&ev);
return TRUE;
}
CORBA_exception_free (&ev);
return view->details->zoomable_frame != CORBA_OBJECT_NIL;
}
void
......
......@@ -458,7 +458,7 @@ nautilus_view_frame_is_zoomable (NautilusViewFrame *view)
g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), FALSE);
CORBA_exception_init (&ev);
is_zoomable = CORBA_Object_is_nil (view->zoomable, &ev);
is_zoomable = !CORBA_Object_is_nil (view->zoomable, &ev);
CORBA_exception_free (&ev);
return is_zoomable;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment