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):
# WidgetGrid panels for overlays
# that have been removed from the
# list.
for overlay in self.__featImages.keys():
for overlay in list(self.__featImages.keys()):
if overlay not in self._overlayList:
featImage = self.__featImages .pop(overlay)
grids = self.__clusterGrids.pop(featImage)
for grid in grids:
if grid is not None:
self.__mainSizer.Detach(grid)
grid.Destroy()
featImage = self.__featImages.pop(overlay)
# Has the feat image associated with
# this overlay also been removed?
if featImage is overlay or \
featImage not in self._overlayList:
# 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.__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