to _tWinMain (in main.cpp). When exiting/closing the application the output results in this:
cocos2d: deallocing CCDirector 025C5DD0
The thread 'Win32 Thread' (0x1914) has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects ->
{199} normal block at 0x025C61C0, 4 bytes long.
Data: < > 00 00 00 00
Object dump complete.
No modifications has been made to code except for the mem leak check snippit. Removing the “Hello World” code from init() (in HellowWorldScene.cpp) has the same result.
Used MSVC2010 and version 2.1.3 of Cocos2dx.
Could it be because of how I installed or setup Cocos2d/projects? Anyone else getting memory leaks?
Yeah, could be, everything else releases correctly with no leaks or problems.
I haven’t had a look at the disassembly yet, but I guess this is a minor issues if an issue at all.
Thanks for the Visual Leak detector check, I’m guessing the problem could be with _CrtSetDbgFlag( *CRTDBG_ALLOC_MEM_DF |*CRTDBG_LEAK_CHECK_DF ) checks, will have to read up on it again.
Thanks, its quick and easy to use. I installed VLD, included it and ran the projects, and it detected no leaks. So I’m going to go with what it says and happily continue coding
Until now I only used the _CrtSetDbgFlag checks for c*+ coding. Haven’t coded in ObjectiveC yet, but until now I’ve had no trouble with mem leaks and such in c*+.
Don’t know if it will help, but I have memory leak on cocos2dx-2.0_2.1.4. Just write Test with boost\test and #include “CCApplication.h” and you will have memory leak:
{693} normal block at 0x00487940, 4 bytes long.
Data: < > 00 00 00 00
Don’t know if it will help, but I have memory leak on cocos2dx-2.0_2.1.4. Just write Test with boost est and #include “CCApplication.h” and you will have memory leak:
{693} normal block at 0x00487940, 4 bytes long.
Data: < > 00 00 00 00
Just did some tests with VS2012, cocos2d-x 3.2 and a clean HelloWorld. Found the memory leak is possibly caused by calling CCLOG with other function calls in it. Both _CrtSetDbgFlag and ALD methods won’t report memory leaks anymore after removing all CCLOG callings.