Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17076

Cocos2d-x 3.10 Memory Leaks

$
0
0

@kuket15 wrote:

In Visual Studio 2015 Community Edition, the CRT reveals memory leaks in Cocos2d-x 3.10.
What am I doing wrong?

1) I create a new project with the command

cocos new -l cpp -p com.test.leaks -d .\Desktop TestLeaks

2) I change main.cpp under proj.win32 like the following

#include "main.h"
#include "AppDelegate.h"
#include "cocos2d.h"

USING_NS_CC;

int APIENTRY _tWinMain(HINSTANCE hInstance,
                       HINSTANCE hPrevInstance,
                       LPTSTR    lpCmdLine,
                       int       nCmdShow)
{
// memory leak detection
#if defined(DEBUG) | defined(_DEBUG)
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

    // create the application instance
    AppDelegate app;
    return Application::getInstance()->run();
}

3) I run the application and I close it with the close button. This is just a part of the output...

Detected memory leaks!
Dumping objects ->
{95953} normal block at 0x06146AF8, 4 bytes long.
 Data: <    > 00 00 00 00 
{95950} normal block at 0x05F896C8, 104 bytes long.
 Data: <        }       > D8 DF D0 10 01 00 00 00 7D 00 00 00 00 00 00 00 
{95949} normal block at 0x06146EE0, 256 bytes long.
 Data: <                > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD 
{95948} normal block at 0x02958EB0, 8 bytes long.
 Data: < ;]     > 88 3B 5D 00 00 00 00 00 
{95947} normal block at 0x02958E78, 8 bytes long.
 Data: <x;]     > 78 3B 5D 00 00 00 00 00 
{95946} normal block at 0x02958D28, 8 bytes long.
 Data: <h;]     > 68 3B 5D 00 00 00 00 00 
{95945} normal block at 0x02958CF0, 8 bytes long.
 Data: <X;]     > 58 3B 5D 00 00 00 00 00 
{95944} normal block at 0x02958CB8, 8 bytes long.
 Data: <H;]     > 48 3B 5D 00 00 00 00 00 
{95943} normal block at 0x005D3B48, 84 bytes long.
 Data: <                > B8 8C 95 02 00 00 00 00 00 00 00 00 00 00 00 00 
{95937} normal block at 0x005E92A0, 16 bytes long.
 Data: <                > 00 00 00 00 CD CD CD CD CD CD CD CD CD CD CD CD 
{95936} normal block at 0x028EE2B0, 32 bytes long.
 Data: <  ^             > A0 92 5E 00 00 00 00 00 00 00 00 00 00 00 00 00 
{95935} normal block at 0x02958C48, 8 bytes long.
 Data: <        > 18 1F BB 02 00 00 00 00 
{95934} normal block at 0x027CA018, 64 bytes long.
 Data: <  ^   ^   ^   ^ > E0 92 5E 00 E0 92 5E 00 E0 92 5E 00 E0 92 5E 00 
{95933} normal block at 0x02958C10, 8 bytes long.
 Data: <        > 00 1F BB 02 00 00 00 00 
{95932} normal block at 0x02958200, 8 bytes long.
 Data: <        > F4 1E BB 02 00 00 00 00 
{95931} normal block at 0x005E92E0, 16 bytes long.
 Data: <  ^   ^         > E0 92 5E 00 E0 92 5E 00 CD CD CD CD CD CD CD CD 
{95930} normal block at 0x02BB1ED0, 88 bytes long.
 Data: <        |       > 88 AE E5 10 01 00 00 00 7C 00 00 00 00 00 00 00 
{95929} normal block at 0x02957B70, 8 bytes long.
 Data: <        > 8C 00 BD 02 00 00 00 00 
{95928} normal block at 0x02957AC8, 8 bytes long.
 Data: <|       > 7C 00 BD 02 00 00 00 00 
{95927} normal block at 0x02958BD8, 8 bytes long.
 Data: <d       > 64 00 BD 02 00 00 00 00 
{95926} normal block at 0x02957B38, 8 bytes long.
 Data: <P       > 50 00 BD 02 00 00 00 00 
{95925} normal block at 0x02BD0040, 3539092 bytes long.
 Data: <               ?> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 3F 
{95924} normal block at 0x027C9FA8, 64 bytes long.
 Data: <   ?            > 00 00 80 3F 00 00 00 00 00 00 00 00 00 00 00 00 
{95923} normal block at 0x028EE300, 32 bytes long.
 Data: <  |             > A8 9F 7C 02 00 00 00 00 00 00 00 00 00 00 00 00 
{95922} normal block at 0x027CA4E8, 64 bytes long.
 Data: <   ?            > 00 00 80 3F 00 00 00 00 00 00 00 00 00 00 00 00 
{95921} normal block at 0x028EE210, 32 bytes long.
 Data: <  |             > E8 A4 7C 02 00 00 00 00 00 00 00 00 00 00 00 00 
{95920} normal block at 0x027CA6A8, 64 bytes long.
 Data: <   ?            > 00 00 80 3F 00 00 00 00 00 00 00 00 00 00 00 00 
{95919} normal block at 0x028EF070, 32 bytes long.
 Data: <  |             > A8 A6 7C 02 00 00 00 00 00 00 00 00 00 00 00 00 
{95918} normal block at 0x027CA408, 64 bytes long.
 Data: <  |   |   |   | > B0 D4 7C 02 B0 D4 7C 02 B0 D4 7C 02 B0 D4 7C 02 
{95917} normal block at 0x02957FD0, 8 bytes long.
 Data: <  8     > 80 B1 38 06 00 00 00 00 
{95916} normal block at 0x02957F60, 8 bytes long.
 Data: <t 8     > 74 B1 38 06 00 00 00 00 
{95915} normal block at 0x027CD4B0, 40 bytes long.
 Data: <  |   |         > B0 D4 7C 02 B0 D4 7C 02 CD CD CD CD CD CD CD CD 
{95914} normal block at 0x02957F98, 8 bytes long.
 Data: <  8     > CC B0 38 06 00 00 00 00 
{95913} normal block at 0x02957EF0, 8 bytes long.
 Data: <  8     > B8 B0 38 06 00 00 00 00 
{95912} normal block at 0x02957CF8, 8 bytes long.
 Data: <  8     > A4 B0 38 06 00 00 00 00
...other leaks...

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17076

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>