Forráskód Böngészése

wxGUI: aui manager in SimpleLayerManager needs to be uninitialized before destroying it

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74099 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 6 éve
szülő
commit
3bd818cd67

+ 1 - 1
gui/wxpython/animation/controller.py

@@ -252,6 +252,7 @@ class AnimationController(wx.EvtHandler):
             animationData=animData)
         dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_CANCEL:
+            dlg.UnInit()
             dlg.Destroy()
             return
         dlg.Destroy()
@@ -324,7 +325,6 @@ class AnimationController(wx.EvtHandler):
         self._updateAnimations(
             activeIndices=indices,
             mapNamesDict=mapNamesDict)
-        wx.Yield()
         self._updateBitmapData()
         # if running:
         #     self.PauseAnimation(False)

+ 6 - 0
gui/wxpython/animation/dialogs.py

@@ -736,9 +736,13 @@ class InputDialog(wx.Dialog):
             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 @@ class EditDialog(wx.Dialog):
         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 @@ class EditDialog(wx.Dialog):
         dlg = InputDialog(parent=self, mode='edit', animationData=animData)
         dlg.CenterOnParent()
         if dlg.ShowModal() == wx.ID_CANCEL:
+            dlg.UnInit()
             dlg.Destroy()
             return
         dlg.Destroy()

+ 4 - 0
gui/wxpython/gui_core/simplelmgr.py

@@ -131,6 +131,10 @@ class SimpleLayerManager(wx.Panel):
         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.
 

+ 4 - 0
gui/wxpython/mapswipe/dialogs.py

@@ -81,6 +81,10 @@ class SwipeMapDialog(wx.Dialog):
 
         self._layout()
 
+    def UnInit(self):
+        self._firstLmgr.UnInit()
+        self._secondLmgr.UnInit()
+
     def _layout(self):
         """Do layout"""
         mainSizer = wx.BoxSizer(wx.VERTICAL)

+ 1 - 0
gui/wxpython/mapswipe/frame.py

@@ -767,6 +767,7 @@ class SwipeMapFrame(DoubleMapFrame):
         self.GetFirstMap().Clean()
         self.GetSecondMap().Clean()
         self._mgr.UnInit()
+        self._inputDialog.UnInit()
         self.Destroy()