From 0d3aa990aa7d076b9d5dd6021a4010722fafadb3 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Mon, 8 Feb 2016 02:57:57 +0300 Subject: [PATCH] *.terminate() added. --- src/AppCore.vala | 3 +++ src/AppDirs.vala | 3 +++ src/MainWindow.vala | 2 +- src/PreferencesWindow.vala | 2 +- src/Resources.vala | 3 +++ src/SubprocessDialog.vala | 2 +- src/main.vala | 7 +++++++ 7 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/AppCore.vala b/src/AppCore.vala index f1f611c..735d8dd 100644 --- a/src/AppCore.vala +++ b/src/AppCore.vala @@ -9,5 +9,8 @@ namespace LAview.Desktop { settings = new AppSettings(); } + public static void terminate () { + core = null; + } } } diff --git a/src/AppDirs.vala b/src/AppDirs.vala index 2f06b66..bf33f3e 100644 --- a/src/AppDirs.vala +++ b/src/AppDirs.vala @@ -24,5 +24,8 @@ namespace LAview.Desktop { if (File.new_for_path(w32dhack_sdir+"/gschemas.compiled").query_exists ()) settings_dir = w32dhack_sdir; } + + public static void terminate () { + } } } diff --git a/src/MainWindow.vala b/src/MainWindow.vala index aa584a9..26e50a6 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -321,7 +321,7 @@ namespace LAview.Desktop { [CCode (instance_pos = -1)] public void action_quit_activate (Gtk.Action action) { - window.application.quit(); + window.destroy(); } } } diff --git a/src/PreferencesWindow.vala b/src/PreferencesWindow.vala index 21ddaab..b7d1f50 100644 --- a/src/PreferencesWindow.vala +++ b/src/PreferencesWindow.vala @@ -20,7 +20,7 @@ namespace LAview.Desktop { dialog = builder.get_object ("preferences_window") as Dialog; dialog.transient_for = parent; dialog.modal = true; - dialog.application = application; + //dialog.application = application; dialog.delete_event.connect ((source) => {return true;}); liststore_data = builder.get_object ("liststore_data") as Gtk.ListStore; liststore_protocols = builder.get_object ("liststore_protocols") as Gtk.ListStore; diff --git a/src/Resources.vala b/src/Resources.vala index 75e495a..6105344 100644 --- a/src/Resources.vala +++ b/src/Resources.vala @@ -7,5 +7,8 @@ namespace LAview.Desktop { resource = Resource.load (resource_file); resource._register(); } + + public static void terminate () { + } } } diff --git a/src/SubprocessDialog.vala b/src/SubprocessDialog.vala index cd30114..1d63d2e 100644 --- a/src/SubprocessDialog.vala +++ b/src/SubprocessDialog.vala @@ -21,7 +21,7 @@ namespace LAview.Desktop { dialog = builder.get_object ("subprocess_dialog") as Dialog; dialog.transient_for = parent; dialog.modal = true; - dialog.application = application; + //dialog.application = application; dialog.delete_event.connect ((source) => {return true;}); textview_stderrout = builder.get_object ("textview_stderrout") as TextView; } diff --git a/src/main.vala b/src/main.vala index c50a61f..fb3bee9 100644 --- a/src/main.vala +++ b/src/main.vala @@ -50,6 +50,13 @@ namespace LAview.Desktop { flags: ApplicationFlags.FLAGS_NONE); } + ~LAviewDesktopApp () { + print ("~LAviewDesktopApp()\n"); + Resources.terminate (); + AppCore.terminate (); + AppDirs.terminate (); + } + protected override void activate () { try { main_window = new MainWindow (this);