[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Destructor being called on a subthread.
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2008-07-31 14:54:05
Message-ID: 5ebcf69a5d2065f2682749415581d98f () localhost
[Download RAW message or body]

On Thu, 31 Jul 2008 14:42:17 +0000 (UTC), Kevin Watters
<kevinwatters@gmail.com> wrote:
> I've got a sporadic crash in my app (not PyQT) and I think I have it
> narrowed down.
> 
> 1) Main thread creates a Flub object. 
> 2) Main thread releases all references to the Flub object, but there's a
> cycle,
> so the object isn't collected immediately.
> 3) Worker thread does some unrelated work, during which a garbage
> collection happens.
> 4) This collection on the worker thread results in a deallocation for
> the Flub object created in (1).
> 5) The Flub object's destructor cleans up structures which are not
> thread safe, and an access violation occurs (sometimes).
> 
> What can I do about this?  I'm thinking about making SIP thunk all
> deallocations for Flub objects back to the main thread, but I wanted to
> see if PyQT has or has confronted this problem before...

You could look at the call to PyObject_GC_UnTrack() in
sipWrapper_dealloc(). I don't think it's the same problem, but there may be
similarities.

Phil

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic