News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

app.cpp redundency

Started by sethjackson, January 09, 2006, 06:31:27 PM

Previous topic - Next topic

sethjackson

Hi there is some redendency in app.cpp.

wxImage::AddHandler(new handler_type);
wxImage::AddHandler(new handler_type);
wxInitAllImageHandlers();

Not good.

This patch fixes the problem.


thomas

I wouldn't go as far as calling it a problem, but you're right insofar as the calls to wxImage::AddHandler() can be saved :)

Done that.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

sethjackson

Well call it what you want, but anyways thanks for fixing it. I was calling it a problem because wxInitAllImageHandlers() actually does


#if wxUSE_IMAGE_TYPE
wxImage::AddHandler(new image_type);
#endif


So by doing


wxImage::AddHandler(new image_type);
wxImage::AddHandler(new image_type);
wxInitAllImageHandlers();


I think that would create those two specfic objects twice...... No matter though.  :)

EDIT:

Could a dev close this patch then?

http://sourceforge.net/tracker/index.php?func=detail&aid=1400549&group_id=126998&atid=707418