From ac856a0581862f9fcf6c7d65ed7f2a6db926d4a9 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Mon, 25 May 2015 05:39:00 -1000 Subject: [PATCH] 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 --- src/plugins/koch.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/koch.py b/src/plugins/koch.py index fbc4b16..89495d9 100644 --- a/src/plugins/koch.py +++ b/src/plugins/koch.py @@ -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