Crash when repeatedly removing and adding a List containing an editable column
Run the following, and hit the "Click" button repeatedly until it crashes. The crash occurs in a fairly deep key/value binding callback.
If in the code below you change editable=True to editable=False, no crash occurs.
I am not sure how to further debug this.
from vanilla import Window, Button, List
class ListTest(object):
def __init__(self):
self.w = Window((600, 400), "Test")
self.w.button = Button((10, 10, 100, 25), "Click", self.buttonClick)
self.setList()
self.w.open()
def buttonClick(self, sender):
del self.w.list
self.setList()
def setList(self):
items = [dict(a=100) for i in range(3)]
descriptions = [dict(title="a", key="a", editable=True)]
self.w.list = List((120, 0, 0, 0), items, columnDescriptions=descriptions)
ListTest()
You may ask: why remove the list and add it again: well, that seems currently the only public way to change the column descriptions.
Here's a crash log:
In addition I sometimes get this error message:
/Applications/RoboFont1.8.app/Contents/Resources/lib/python2.7/vanilla/vanillaList.py:467: UninitializedDeallocWarning: leaking an uninitialized object of type VanillaArrayController
@justvanrossum
You may ask: why remove the list and add it again: well, that seems currently the only public way to change the column descriptions.
Do you remember what you needed to change in the column descriptions? I want to enable adding/removing columns after creation and I can address this issue at the same time. (The change will apply to List2. List2 is a billion times better than List :)
Do you remember
That's... close to six years ago, I haven't got the faintest...
see the Designspace editor to update columns in the same table view: https://github.com/LettError/designSpaceRoboFontExtension/blob/master/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py#L1728-L1763