Memory management feedback :)

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

RottenMan
Just popping in
Just popping in
Posts: 1
Joined: Mon Feb 04, 2013 03:31

Memory management feedback :)

Postby RottenMan » Tue Feb 05, 2013 11:06

Hello,

I'm trying to integrate CEGUI into an existing codebase and noticed the following:

Factories that are added to CEGUI::WindowFactoryManager::addFactory<typename T> gets pushed into a vector called d_ownedFactories in the line:

d_ownedFactories.push_back(factory);

Is it possible to make this vector non-static? In particular if the user has overloaded global new/delete there is a potential for the wrong variant of the memory management function to be called (depending on whether the memory manager has been inited or not).

thank you!

best regards,
anis

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Memory management feedback :)

Postby CrazyEddie » Wed Feb 06, 2013 09:09

This is not the only static object in the library and the objects that are static are static for a reason. In this case, so that types and factories can be preregistered with the system prior to instantiation of the main system objects (there was a specific reason for this case, I don't recall what it was off the top of my head - it may be on the forum somewhere).

I appreciate there are scenarios where the use of these static objects may cause issues, though I am reluctant to stop using language features because of what might happen in a couple of cases. This said, the long term plan is to remove all singletons from the library, so at that point statics such as the one you highlight will cease to be static. In the interim, it definitely can't change for 0.7.x and almost certainly won't change in 1.0 - unless someone else does the work, does not break the reason we added that static (search the forum), and impresses us (me?) with their work.

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 3 guests