Memory leaks
C/C++ programmers usually have problems with memory leaks, and one should known that those tiny bytes lost in you memory can lead to a big crash on your game.
Every time you run your game Make sure to always check if there is no memory leaks in your code , and if your compiler find some leaks, fix it ASAP! Do not let it for later. Later it will be hard to find, and there will be more leaks.
Besides always checking it, try avoiding them.
1) Always delete/release the objects you created
2) Do not use the "new" statement twice for the same object, and if you do, make sure to delete the older reference to the object.
3) If you point an object to another place on the memory, make sure to release the memory assigned before (if that is the case).

Add new comment