[GRASS-SVN] r74099 - in grass/trunk/gui/wxpython: animation gui_core mapswipe

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 17 12:13:19 PST 2019


Author: annakrat
Date: 2019-02-17 12:13:19 -0800 (Sun, 17 Feb 2019)
New Revision: 74099

Modified:
   grass/trunk/gui/wxpython/animation/controller.py
   grass/trunk/gui/wxpython/animation/dialogs.py
   grass/trunk/gui/wxpython/gui_core/simplelmgr.py
   grass/trunk/gui/wxpython/mapswipe/dialogs.py
   grass/trunk/gui/wxpython/mapswipe/frame.py
Log:
wxGUI: aui manager in SimpleLayerManager needs to be uninitialized before destroying it

Modified: grass/trunk/gui/wxpython/animation/controller.py
===================================================================
--- grass/trunk/gui/wxpython/animation/controller.py	2019-02-17 15:55:08 UTC (rev 74098)
+++ grass/trunk/gui/wxpython/animation/controller.py	2019-02-17 20:13:19 UTC (rev 74099)
@@ -252,6 +252,7 @@
             animationData=animData)
         dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_CANCEL:
+            dlg.UnInit()
             dlg.Destroy()
             return
         dlg.Destroy()
@@ -324,7 +325,6 @@
         self._updateAnimations(
             activeIndices=indices,
             mapNamesDict=mapNamesDict)
-        wx.Yield()
         self._updateBitmapData()
         # if running:
         #     self.PauseAnimation(False)

Modified: grass/trunk/gui/wxpython/animation/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/animation/dialogs.py	2019-02-17 15:55:08 UTC (rev 74098)
+++ grass/trunk/gui/wxpython/animation/dialogs.py	2019-02-17 20:13:19 UTC (rev 74099)
@@ -736,9 +736,13 @@
             self.animationData.endRegion = None
             self.animationData.zoomRegionValue = None
 
+    def UnInit(self):
+        self.simpleLmgr.UnInit()
+
     def OnOk(self, event):
         try:
             self._update()
+            self.UnInit()
             self.EndModal(wx.ID_OK)
         except (GException, ValueError, IOError) as e:
             GError(
@@ -848,6 +852,7 @@
         dlg = InputDialog(parent=self, mode='add', animationData=animData)
         dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_CANCEL:
+            dlg.UnInit()
             dlg.Destroy()
             return
         dlg.Destroy()
@@ -864,6 +869,7 @@
         dlg = InputDialog(parent=self, mode='edit', animationData=animData)
         dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_CANCEL:
+            dlg.UnInit()
             dlg.Destroy()
             return
         dlg.Destroy()

Modified: grass/trunk/gui/wxpython/gui_core/simplelmgr.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/simplelmgr.py	2019-02-17 15:55:08 UTC (rev 74098)
+++ grass/trunk/gui/wxpython/gui_core/simplelmgr.py	2019-02-17 20:13:19 UTC (rev 74099)
@@ -131,6 +131,10 @@
         for i, layer in enumerate(self._layerList):
             layer.Select(i in selected)
 
+    def UnInit(self):
+        """Needs to be called before destroying this window"""
+        self._auimgr.UnInit()
+
     def OnContextMenu(self, event):
         """Show context menu.
 

Modified: grass/trunk/gui/wxpython/mapswipe/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/mapswipe/dialogs.py	2019-02-17 15:55:08 UTC (rev 74098)
+++ grass/trunk/gui/wxpython/mapswipe/dialogs.py	2019-02-17 20:13:19 UTC (rev 74099)
@@ -81,6 +81,10 @@
 
         self._layout()
 
+    def UnInit(self):
+        self._firstLmgr.UnInit()
+        self._secondLmgr.UnInit()
+
     def _layout(self):
         """Do layout"""
         mainSizer = wx.BoxSizer(wx.VERTICAL)

Modified: grass/trunk/gui/wxpython/mapswipe/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapswipe/frame.py	2019-02-17 15:55:08 UTC (rev 74098)
+++ grass/trunk/gui/wxpython/mapswipe/frame.py	2019-02-17 20:13:19 UTC (rev 74099)
@@ -767,6 +767,7 @@
         self.GetFirstMap().Clean()
         self.GetSecondMap().Clean()
         self._mgr.UnInit()
+        self._inputDialog.UnInit()
         self.Destroy()
 
 



More information about the grass-commit mailing list