fulvio ciriaco <email@example.com>
Cc: firstname.lastname@example.org; email@example.com
Sent: Thursday, 21 February 2013, 20:41
Subject: Re: [Plplot-devel] [ plplot-Bugs-3604554 ] wxwidgets window
but the patch does not work here, i.e. debian.
I applied it to plplot latest from sourceforge:
a. it still segfaults as soon as drawing after calling plinit second time
b. does not correctly tidy up, i.e. close the window after plend
From: phil rosenberg <firstname.lastname@example.org
Subject: Re: [Plplot-devel] [
plplot-Bugs-3604554 ] wxwidgets window
Date: Thu, 21 Feb 2013 09:52:51 -0800 (PST)
> I just tweaked example 00c so that after plend() the gui the plot creation is repeated starting with plinit().
> The segfault problem is caused by the static install_buffer function in wxwidgets.cpp. There is a static bool called initApp which is set to true on the first call to plinit(). Because the variable is local it can't be reset to false by plend() so wxWidgets does its tidying, destroys the wxApp but on the second call to plinit the wxApp is not recreated giving a segfault when the top level frame tries to access it.
> I've move initApp into wxPLDevBase and the segfault is now avoided.
> I've attached a patch, but my copy of PLplot currently has a few modifications and isn't quite up to date so if it won't apply please let me know and I'll download a fresh copy to patch instead.
> From: phil rosenberg <email@example.com
> To: "firstname.lastname@example.org
> Sent: Thursday, 21 February 2013, 15:31
> Subject: [Plplot-devel] [ plplot-Bugs-3604554 ]
> I think there are a few complexities around when closing the final windows in wxWidgets. I don't know if you remember some months ago a user reporting memory leaks with the wxWidgets examples. I think this came down to the fact that wxWidgets ends the program when its final window is closed without passing control back to the example code meaning that memory allocated there was never released. Perhaps the issues are linked - something to do with wxwidgets have done all its cleaning up, but PLplot expecting to be able to reinitiate something?
> If you would like me to have a look into it then if you drop me the segfault example I'll see what it does on my (Windows) system.