[Freewx-maint] Bug#242737: libwxgtk2.4-python: Segfaults on invocation of SetTimeT

Olly Betts olly at survex.com
Wed May 30 02:54:35 UTC 2012

On Thu, Oct 13, 2011 at 09:10:18AM -0700, Robin Dunn wrote:
> SWIG has a problem with methods that return a reference to self, and
> it treats the intermediate results as temporaries and creates new
> proxies for them.  When chaining calls together like that it ends up
> thinking that the original object is no longer referenced and it
> lets Python delete it.  Since the reference saved in d is actually a
> proxy to the same C++ object then it ends up with an invalid
> pointer.
> I'll add the code to stop SWIG's confusion in this case.  In the
> meantime you can work around it by not chaining the constructor and
> method calls together so you can hold on to the original reference.

Robin's fixed this on wx trunk and closed the upstream ticket, so sadly
it looks like this won't get fixed in the wx 2.8 series.

So I've tagged this as "wontfix" and have closed it.  There's a simple
workaround which works in 2.8 and should work in the future too - just
don't chain the calls.


More information about the Freewx-maint mailing list