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:
parent
1045da3556
commit
ac856a0581
@ -126,9 +126,13 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
class KochSnowflakePlugin(LSystemPlugin):
|
class KochSnowflakePlugin(LSystemPlugin):
|
||||||
displayName = "Koch Snowflake"
|
displayName = "Koch Snowflake"
|
||||||
|
_optionsWidget = None
|
||||||
|
|
||||||
def getOptionsWidget(self):
|
def getOptionsWidget(self):
|
||||||
widget = QtGui.QWidget()
|
if self._optionsWidget:
|
||||||
|
return self._optionsWidget
|
||||||
|
|
||||||
|
widget = self._optionsWidget = QtGui.QWidget()
|
||||||
|
|
||||||
self.blockTypeButton = BlockTypeButton()
|
self.blockTypeButton = BlockTypeButton()
|
||||||
self.blockTypeButton.editorSession = self.editorSession
|
self.blockTypeButton.editorSession = self.editorSession
|
||||||
|
Reference in New Issue
Block a user