gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnumed-devel] trouble with wx.ListCtrl.DeleteAllItems()


From: Karsten Hilbert
Subject: [Gnumed-devel] trouble with wx.ListCtrl.DeleteAllItems()
Date: Thu, 24 Jan 2013 10:52:30 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi all,

from time to time --  under not yet fully understood
circumstances -- the following code snippet actually
succeeds in throwing an exception in our application
(www.gnumed.de) running under wxPython 2.8.12.1 on
Debian (self is a wx.ListCtrl child):

        def set_string_items(self, items = None):
                """All item members must be unicode()able or None."""

                self.DeleteAllItems()
                if self.ItemCount != 0:
                        raise ValueError('.ItemCount not 0 after 
.DeleteAllItems()')

There's basically three potential reasons:

1) DeleteAllItems() is broken

        This is unlikely because a) it works as expected most of
        the time and b) it seems quite a prominent method in the
        wxPython body of code such that this kind of breakage
        would have been fixed by now.

2) DeleteAllItems() only schedules deletion of items which
   then happens in a delayed fashion

        I have not been able to confirm this on the web anywhere.

3) two threads get in the way of each other trying to
   use set_string_items()

        A race *could* happen between
                self.DeleteAllItems()
        and
                self.ItemCount

        Yes, we do have threads but, no, we are taking care to
        wrap them in wx.CallAfter() as needed (might have missed
        something somewhere).

I am currently investigating 3). Are there any further
hints, or maybe knowledge on 1) or 2) to be had ?

Thanks,
Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]