Browse 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 5 năm trước cách đây
mục cha
commit
c934bb68b4
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  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"""