Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: sethjackson on January 09, 2006, 06:31:27 PM

Title: app.cpp redundency
Post by: sethjackson on January 09, 2006, 06:31:27 PM
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.

Title: Re: app.cpp redundency
Post by: thomas on January 09, 2006, 06:42:15 PM
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.
Title: Re: app.cpp redundency
Post by: sethjackson on January 09, 2006, 07:27:18 PM
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