Fix crash when switching back to Koch Snowflake plugin

Options widget was being recreated. When the previous widget is deleted, it deletes all of its children, including self.iterationsSlider.

Maybe make sure getOptionsWidget is only called once and cache its result in GeneratePlugin
This commit is contained in:
David Vierra 2015-05-25 05:39:00 -10:00
parent 1045da3556
commit ac856a0581

View File

@ -126,9 +126,13 @@ if __name__ == '__main__':
class KochSnowflakePlugin(LSystemPlugin):
displayName = "Koch Snowflake"
_optionsWidget = None
def getOptionsWidget(self):
widget = QtGui.QWidget()
if self._optionsWidget:
return self._optionsWidget
widget = self._optionsWidget = QtGui.QWidget()
self.blockTypeButton = BlockTypeButton()
self.blockTypeButton.editorSession = self.editorSession