Hi
I'm emailing with a patch which I believe fixes a bug in the wxWidgets driver.
 
The problem occurrs when trying to include plplot in a wxWidgets application 
that is separate to PLplot - i.e. when the user wants to use their own 
derivation of wxApp rather than wxPLplotApp.
The bug manifests itself as an apparent hang before any windows have appeared. 
In the past I've worked around it by removing wxwidgets_app.cpp and all 
reference to its contents from plplot before compilation, but this is clearly 
not ideal.
 
After some digging I found that the bug boils down to a static function pointer 
which the user assigns defining the wxApp derived class to use. Unfortunately 
after the user has assigned this function pointer PLplot reassigns it meaning a 
wxPLplotApp is used instead of the user's wxApp.
 
The fix is to simply check if the pointer is NULL (as initialised by 
wxWidgets) before assignment. This ensures wxPLplotApp is only used if the user 
hasn't assigned their own function first.
 
I have tested this from the perspective of avoiding the crash, but I've never 
used wxPLplotApp before. If someone has this up and running could they check it 
doesn't cause any problems?
 
Cheers
 
Phil

Attachment: wxwidgets_initializer.patch
Description: Binary data

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to