Parcourir la source

Removing map layer crashes wxGUI (trac.osgeo.org/grass/ticket/3607) (#462)

* fix https://trac.osgeo.org/grass/ticket/3607

* add explanation
Anna Petrasova il y a 5 ans
Parent
commit
2f4d3abd19
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      gui/wxpython/lmgr/layertree.py

+ 3 - 1
gui/wxpython/lmgr/layertree.py

@@ -421,7 +421,9 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
             # select the layer in the same way as right click
             if not self.IsSelected(layer):
                 self.DoSelectItem(layer, True, False)
-            self.OnLayerContextMenu(event)
+            # CallAfter to allow context button events to finish
+            # before destroying it when layer is deleted (mac specific)
+            wx.CallAfter(self.OnLayerContextMenu, event)
 
     def OnLayerContextMenu(self, event):
         """Contextual menu for item/layer"""