-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
When you create your scene, you use C++'s builtin 'new' operator. This allocates heap memory, which must be freed. At the end of the program, you do not clean up your resources for the scene. This is a memory leak. You need to call 'delete' on the loading scene and the game scene, otherwise this memory is never freed. There may be more memory leaks, I haven't looked. Please deallocate your resources after you use them. If you want to abstract away the details of how memory is managed for your scene objects, you can use smart pointers such as unique_ptr() and shared_ptr() to manage refrence counting or scope to deal with lifetimes. This way, memory is not left unfreed after the program has finished running.
Metadata
Metadata
Assignees
Labels
No labels