Skip to content
Snippets Groups Projects
Commit d6b00f3c authored by Paul McCarthy's avatar Paul McCarthy
Browse files

ClusterPanel was throwing exceptions occasionally when destroying widget

grids, due to slightly incorrect logic in overlay list changed handler.
parent 1afbd81d
No related branches found
No related tags found
No related merge requests found
...@@ -439,16 +439,26 @@ class ClusterPanel(fslpanel.FSLEyesPanel): ...@@ -439,16 +439,26 @@ class ClusterPanel(fslpanel.FSLEyesPanel):
# WidgetGrid panels for overlays # WidgetGrid panels for overlays
# that have been removed from the # that have been removed from the
# list. # list.
for overlay in self.__featImages.keys(): for overlay in list(self.__featImages.keys()):
if overlay not in self._overlayList: if overlay not in self._overlayList:
featImage = self.__featImages .pop(overlay) featImage = self.__featImages.pop(overlay)
grids = self.__clusterGrids.pop(featImage)
# Has the feat image associated with
for grid in grids: # this overlay also been removed?
if grid is not None: if featImage is overlay or \
self.__mainSizer.Detach(grid) featImage not in self._overlayList:
grid.Destroy()
# The grid widgets for the feat image
# associated with this overlay may
# have already been destroyed.
try: grids = self.__clusterGrids.pop(featImage)
except KeyError: grids = []
for grid in grids:
if grid is not None:
self.__mainSizer.Detach(grid)
grid.Destroy()
self.__selectedOverlayChanged() self.__selectedOverlayChanged()
self.__enableOverlayButtons() self.__enableOverlayButtons()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment