Deploy ".xap" file problem

Hi everyone,
First, sorry for my bad English.
I have a problem with deploy xap file. When i test my game on Emulator. It works fine. (Debug + Release). When I test on device through VS2013 (Release). It works fine.
But, when i stop Visual Studio, and run my game only (Or deploy “.xap” file from directory "…/ARM/Release by Application Deployment). My game works not well. When i access gameplay (useBox2D), sometimes my game crashes. Other scenes work fine (don’t use Box2D).
What’s going on? I am sure my game work fine when i build it through Visual Studio.
Please help me, thanks!

Hi, your error seams to be a memory problem. Sometimes it works, sometimes it crashes, often when there is no debugger attached. Check your game for memory errors. Something is used after being deleted from memory. Check if you have a balanced use of retain(), release(), autorelease(). Normally this is not necessary with C++ but cocos2d-x uses this.

Jesko Thiele wrote:

Hi, your error seams to be a memory problem. Sometimes it works, sometimes it crashes, often when there is no debugger attached. Check your game for memory errors. Something is used after being deleted from memory. Check if you have a balanced use of retain(), release(), autorelease(). Normally this is not necessary with C*+ but cocos2d-x uses this.
Hi Jesko Thiele, thank for your answer.
I had problem with memory and i have fixed it. Before, my game crashes and throws exception “Out Of Memory”, so i spent a week to fix it and it works fine
If it still caused memory problem. Why it works fine when i test by device through Visual Studio? So, what is diffenrent between : deploy by visual* device, and deploy on device only?
How i fix the bugs if it has no exceptions or error message when i debug? (everything ok when i debug) :frowning:

That’s the problem with memory issues using deleted pointers. Sometimes the memory which the pointer points to will not be immediately erased. If you access this memory you will not get a SIGFAULT and your game works perfectly. When you start the game using VS the memory order can be different and your game will work. But I know from decades of experience that your problem is typical for memory related issues. Try running your game on another platform like android. If you use a different compiler maybe you get better hints where your memory issue comes from.

Thank you, I resolved the problem!