vanilla icon indicating copy to clipboard operation
vanilla copied to clipboard

Crash when repeatedly removing and adding a List containing an editable column

Open justvanrossum opened this issue 8 years ago • 5 comments

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()

justvanrossum avatar Jan 11 '18 21:01 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.

justvanrossum avatar Jan 11 '18 21:01 justvanrossum

Here's a crash log:

vanilla-list-crash-log.txt

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

michielkauwatjoe avatar Jan 12 '18 10:01 michielkauwatjoe

@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 :)

typesupply avatar Dec 20 '23 15:12 typesupply

Do you remember

That's... close to six years ago, I haven't got the faintest...

justvanrossum avatar Dec 22 '23 10:12 justvanrossum

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

typemytype avatar Dec 22 '23 11:12 typemytype