diff options
author | Alex Merry <alex.merry@cs.ox.ac.uk> | 2013-02-04 12:09:24 +0000 |
---|---|---|
committer | Alex Merry <alex.merry@cs.ox.ac.uk> | 2013-02-04 12:09:24 +0000 |
commit | e92425f179ee806eb27c10b47709b7ea2833a90b (patch) | |
tree | 63440cec9b7655014c83d49594f8d9801da43360 /tikzit/src/gtk/SettingsDialog.m | |
parent | 5349460f6ba630d92ab61f4cbe1c04210e7684cc (diff) |
Clean up the SettingsDialog class a little
Diffstat (limited to 'tikzit/src/gtk/SettingsDialog.m')
-rw-r--r-- | tikzit/src/gtk/SettingsDialog.m | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tikzit/src/gtk/SettingsDialog.m b/tikzit/src/gtk/SettingsDialog.m index 11a0d0d..a70a412 100644 --- a/tikzit/src/gtk/SettingsDialog.m +++ b/tikzit/src/gtk/SettingsDialog.m @@ -50,13 +50,24 @@ static void cancel_button_clicked_cb (GtkButton *widget, SettingsDialog *dialog) if (self) { configuration = [c retain]; - parentWindow = NULL; - window = NULL; } return self; } +- (void) dealloc { + if (window) { + gtk_widget_destroy (GTK_WIDGET (window)); + } + if (parentWindow) { + g_object_unref (parentWindow); + } + + [configuration release]; + + [super dealloc]; +} + - (Configuration*) configuration { return configuration; } @@ -68,6 +79,10 @@ static void cancel_button_clicked_cb (GtkButton *widget, SettingsDialog *dialog) [self revert]; } +- (GtkWindow*) parentWindow { + return parentWindow; +} + - (void) setParentWindow:(GtkWindow*)parent { GtkWindow *oldParent = parentWindow; @@ -118,21 +133,6 @@ static void cancel_button_clicked_cb (GtkButton *widget, SettingsDialog *dialog) } } -- (void) dealloc { - [configuration release]; - configuration = nil; - - if (window) { - gtk_widget_destroy (GTK_WIDGET (window)); - window = NULL; - } - if (parentWindow) { - g_object_ref (parentWindow); - } - - [super dealloc]; -} - @end // }}} |