Need help with OGRE engine memory leak
Hi all,
I am working on a game utilizing the OGRE engine. Programming is done in C++. I am getting the following memory leak that I need help resolving:
Alloc. Addr Size Addr Size BreakOn BreakOn
Number Reported Reported Actual Actual Unused Method Dealloc Realloc Allocated by
------ ---------- ---------- ---------- ---------- ---------- -------- ------- ------- ---------------------------------------------------
000018 0x07529A48 0x00000034 0x07529A38 0x00000054 0x00000000 new N N ogregraphicssystemimpl.cpp(30) Star::OgreGraphicsSystemImpl::OgreGraph
Where line 30 in ogregraphicssystemimpl.cpp looks like this:
logMgr = new Ogre::LogManager;
logMgr is defined like so in file ogregraphicssystemimpl.h:
Ogre::LogManager* logMgr;
My operating system is Windows XP SP2 and the development environment is Visual Studio 2005.
Any help would be appreciated.
[Edited by - lougv22 on June 5, 2007 1:51:42 PM]
Well seems kinda obvious so I'm sure you are, but are you calling:
delete logMgr;
somewhere in your code?
delete logMgr;
somewhere in your code?
Yes, I am deleting it. I have a destructor for the class that looks like this::
OgreGraphicsSystemImpl::~OgreGraphicsSystemImpl()
{
.............
..................
if(logMgr) STAR_DELETE(logMgr);
.................
.................
}
where STAR_DELETE is a method that takes care of the deleting.
OgreGraphicsSystemImpl::~OgreGraphicsSystemImpl()
{
.............
..................
if(logMgr) STAR_DELETE(logMgr);
.................
.................
}
where STAR_DELETE is a method that takes care of the deleting.
Oops, never mind that. The reason why I was getting that memory leak report was because I did not shut down the game the proper way. I exited by clicking the Stop Debugging button (it looks like a square) in Visual Studio 2005, which I guess caused the game to exit prematurely without going through all of its clean-up routines, hence the memory leaks.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement