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.
 
Phil
 

________________________________
 From: phil rosenberg <[email protected]>
To: "[email protected]" <[email protected]>; 
"[email protected]" <[email protected]> 
Sent: Thursday, 21 February 2013, 15:31
Subject: [Plplot-devel] [ plplot-Bugs-3604554 ] wxwidgets window
  

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.

Phil    

Attachment: initapp.patch
Description: Binary data

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to