Fixed bug finalizing window
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 31 Dec 2008 04:20:15 +0000 (13:20 +0900)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 31 Dec 2008 04:20:15 +0000 (13:20 +0900)
src/ui/gui/psppire-window.c

index 8405dba7fd91e81a5413482b698038cfb889f491..767e10541d679ee028cbbee3dae14327699855fb 100644 (file)
@@ -35,7 +35,7 @@ static void psppire_window_init          (PsppireWindow      *window);
 
 
 static PsppireWindowClass *the_class;
-
+static GObjectClass *parent_class;
 
 GType
 psppire_window_get_type (void)
@@ -181,20 +181,11 @@ psppire_window_finalize (GObject *object)
   PsppireWindow *window = PSPPIRE_WINDOW (object);
   PsppireWindowClass *class = PSPPIRE_WINDOW_CLASS (G_OBJECT_GET_CLASS (object));
 
-  GtkWindowClass *parent_class = g_type_class_peek_parent (class);
-
-  if ( window->finalized )
-    return;
-
-  window->finalized = TRUE;
-
-  g_debug ("%s %p", __FUNCTION__, object);
-
   g_hash_table_remove (class->name_table, window->name);
   free (window->name);
 
   if (G_OBJECT_CLASS (parent_class)->finalize)
-     (*G_OBJECT_CLASS (parent_class)->finalize) (object);
+    G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 
@@ -203,6 +194,8 @@ psppire_window_class_init (PsppireWindowClass *class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (class);
 
+
+
   GParamSpec *use_class_spec =
     g_param_spec_enum ("usage",
                       "Usage",
@@ -238,6 +231,7 @@ psppire_window_class_init (PsppireWindowClass *class)
   g_hash_table_insert (class->name_table, "Untitled", NULL);
 
   the_class = class;
+  parent_class = g_type_class_peek_parent (class);
 }