[gitg] Set repository to null when closing window



commit 64b17f3e7f0d13866b6e2a03318004b1f2c99210
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Thu Aug 6 08:48:46 2015 +0200

    Set repository to null when closing window
    
    This forces some finalization and cleanup to happen

 gitg/gitg-window.vala |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 180f8df..4e72758 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -279,6 +279,23 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
                                            0);
        }
 
+       protected override bool delete_event(Gdk.EventAny event)
+       {
+               var ret = false;
+
+               if (base.delete_event != null)
+               {
+                       ret = base.delete_event(event);
+               }
+
+               if (!ret)
+               {
+                       repository = null;
+               }
+
+               return ret;
+       }
+
        private void on_close_activated()
        {
                close();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]