allocate/free from different module

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

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

Re: allocate/free from different module

Postby CrazyEddie » Mon Feb 07, 2005 11:28

Nobody Important wrote:
Use CEGUI with Ogre, Windows XP, debug version:

I just get head code from cvs and found that xxxResourceProvider::loadRawDataContainer allocates memoery for
RawDataContainer& output, then the memory is freed by RawDataContainer, the allocate code and free code are located in dfferent module (dll), this will generate a GP while freeing the memory.

I think this is a problem, the solution is to keep allocate/free in same module.


It's only a problem on Win32 when you link to the c/c++ runtime statically, which is why things are set up to link dynamically with the runtime (which ensures that all allocations / frees are done on the heap belonging to the runtime dll).

CE.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 16 guests