Ver código fonte

g.gui.timeline: destructor is not called for some reason, db connection must be closed on close event

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70594 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 8 anos atrás
pai
commit
944dfa72bd
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      gui/wxpython/timeline/frame.py

+ 3 - 1
gui/wxpython/timeline/frame.py

@@ -85,14 +85,16 @@ class TimelineFrame(wx.Frame):
         # We create a database interface here to speedup the GUI
         self.dbif = tgis.SQLDatabaseInterfaceConnection()
         self.dbif.connect()
+        self.Bind(wx.EVT_CLOSE, self.OnClose)
 
-    def __del__(self):
+    def OnClose(self, event):
         """Close the database interface and stop the messenger and C-interface
            subprocesses.
         """
         if self.dbif.connected is True:
             self.dbif.close()
         tgis.stop_subprocesses()
+        self.Destroy()
 
     def _layout(self):
         """Creates the main panel with all the controls on it: