Commit 65e10920 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Just dispose of the view. That will both break cycles and indirectly

2005-06-12  Morten Welinder  <terra@gnome.org>

	* src/workbook.c (workbook_detach_view): Just dispose of the view.
	That will both break cycles and indirectly unref.
	(workbook_sheet_delete): Ditto.

	* src/workbook-view.c (wb_view_sheet_add): Don't leak a ref to the
	new view.

	* src/sheet-view.c (sheet_view_new): Ref the sheet view when we
	add it to the sheet's list of views.
	(sv_real_dispose): Unref as we remove from said list.
parent 16095e8b
2005-06-12 Morten Welinder <terra@gnome.org>
* src/workbook.c (workbook_detach_view): Just dispose of the view.
That will both break cycles and indirectly unref.
(workbook_sheet_delete): Ditto.
* src/workbook-view.c (wb_view_sheet_add): Don't leak a ref to the
new view.
* src/sheet-view.c (sheet_view_new): Ref the sheet view when we
add it to the sheet's list of views.
(sv_real_dispose): Unref as we remove from said list.
2005-06-10 Morten Welinder <terra@gnome.org>
* src/dependent.c (link_cellrange_dep, unlink_cellrange_dep): Fix
......
......@@ -78,6 +78,7 @@ Morten:
* Fix 3D deps crash.
* Fix 3D dependencies spanning more than one sheet. (I.e., all.)
* Fix dynamic dependency crash on exit.
* Plug leaks of sheet views.
--------------------------------------------------------------------------
Gnumeric 1.5.1
......
2005-06-12 Morten Welinder <terra@gnome.org>
* src/workbook.c (workbook_detach_view): Just dispose of the view.
That will both break cycles and indirectly unref.
(workbook_sheet_delete): Ditto.
* src/workbook-view.c (wb_view_sheet_add): Don't leak a ref to the
new view.
* src/sheet-view.c (sheet_view_new): Ref the sheet view when we
add it to the sheet's list of views.
(sv_real_dispose): Unref as we remove from said list.
2005-06-10 Morten Welinder <terra@gnome.org>
* src/dependent.c (link_cellrange_dep, unlink_cellrange_dep): Fix
......
......@@ -191,6 +191,7 @@ sv_real_dispose (GObject *object)
sv->sheet = NULL;
g_ptr_array_remove (sheet->sheet_views, sv);
g_signal_handlers_disconnect_by_func (sheet, sv_sheet_name_changed, sv);
g_object_unref (sv);
g_object_unref (sheet);
}
......@@ -251,6 +252,7 @@ sheet_view_new (Sheet *sheet, WorkbookView *wbv)
sv->sheet = g_object_ref (sheet);
sv->wbv = wbv;
g_ptr_array_add (sheet->sheet_views, sv);
g_object_ref (sv);
g_signal_connect (G_OBJECT (sheet),
"notify::name",
......
......@@ -129,6 +129,8 @@ wb_view_sheet_add (WorkbookView *wbv, Sheet *new_sheet)
WORKBOOK_VIEW_FOREACH_CONTROL (wbv, control,
wb_control_sheet_add (control, new_view););
g_object_unref (new_view);
}
void
......
......@@ -136,7 +136,7 @@ workbook_dispose (GObject *wb_object)
if (wb->wb_views != NULL) {
WORKBOOK_FOREACH_VIEW (wb, view, {
workbook_detach_view (view);
g_object_unref (G_OBJECT (view));
g_object_unref (view);
});
if (wb->wb_views != NULL)
g_warning ("Unexpected left over views");
......@@ -744,15 +744,12 @@ workbook_attach_view (Workbook *wb, WorkbookView *wbv)
void
workbook_detach_view (WorkbookView *wbv)
{
SheetView *sv;
g_return_if_fail (IS_WORKBOOK_VIEW (wbv));
g_return_if_fail (IS_WORKBOOK (wbv->wb));
WORKBOOK_FOREACH_SHEET (wbv->wb, sheet, {
sv = sheet_get_view (sheet, wbv);
SheetView *sv = sheet_get_view (sheet, wbv);
sv_dispose (sv);
g_object_unref (G_OBJECT (sv));
});
g_ptr_array_remove (wbv->wb->wb_views, wbv);
......@@ -1084,7 +1081,6 @@ workbook_sheet_delete (Sheet *sheet)
/* Clear the controls first, before we potentially update */
SHEET_FOREACH_VIEW (sheet, view, {
sv_dispose (view);
g_object_unref (G_OBJECT (view));
});
g_signal_emit_by_name (G_OBJECT (sheet), "detached_from_workbook", wb);
......
Markdown is supported
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