wxPython crash - printing (i.e. plot.py demo)

wxPython crashes without any traceback when I do:

wxPython demo:
- pyplot under More Windows/Controls
- Menu File/Page Setup
- Close dialog
- Select again File/Page Setup

Boa:
Seeing the same thing trying to print a source file

This is on Windows XP Pro SP1, Python 2.4 and wxPython 2.5.5.0 pre

Any hints would be appreciated on how to correct this or how to work around it.

See you
Werner

Hi
I show a panel and move another at the beginning of a function, I call
Refresh() but the refresh doesn't occur till the function concludes, which
as a text control on one of the panels is supposed to tell the user what is
going on rather unsatisfactory.
How do I force a refresh?
Greg

Werner F. Bruhin wrote:

wxPython crashes without any traceback when I do:

wxPython demo:
- pyplot under More Windows/Controls
- Menu File/Page Setup
- Close dialog
- Select again File/Page Setup

Boa:
Seeing the same thing trying to print a source file

This is on Windows XP Pro SP1, Python 2.4 and wxPython 2.5.5.0 pre

Any hints would be appreciated on how to correct this or how to work around it.

When PyPlot is saving the results of the page setup dialog in self.print_data it is setting it to a reference to the wxPrintData held in the page setup dialog. So when that dialog is destroyed the data object is destroyed as well, leaving you with a dangling reference in self.print_data. Forcing it to make a copy takes care of the problem.

http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/wxPython/wx/lib/plot.py.diff?r1=1.9&r2=1.10&diff_format=u

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hi Robin,

Robin Dunn wrote:

Werner F. Bruhin wrote:

wxPython crashes without any traceback when I do:

wxPython demo:
- pyplot under More Windows/Controls
- Menu File/Page Setup
- Close dialog
- Select again File/Page Setup

Boa:
Seeing the same thing trying to print a source file

This is on Windows XP Pro SP1, Python 2.4 and wxPython 2.5.5.0 pre

Any hints would be appreciated on how to correct this or how to work around it.

When PyPlot is saving the results of the page setup dialog in self.print_data it is setting it to a reference to the wxPrintData held in the page setup dialog. So when that dialog is destroyed the data object is destroyed as well, leaving you with a dangling reference in self.print_data. Forcing it to make a copy takes care of the problem.

http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/wxPython/wx/lib/plot.py.diff?r1=1.9&r2=1.10&diff_format=u

Thanks for the diff, this works perfectly!

Any change that wxPython could crash a "bit friendlier" in a case like this, i.e. show an exception?

Best regards
Werner