Author Topic: app.cpp redundency  (Read 4418 times)

sethjackson

  • Guest
app.cpp redundency
« 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.

 
« Last Edit: January 09, 2006, 07:28:14 pm by sethjackson »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: app.cpp redundency
« Reply #1 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

sethjackson

  • Guest
Re: app.cpp redundency
« Reply #2 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

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

So by doing

Code
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