April 2017
Beginner to intermediate
394 pages
9h 16m
English
People also are used to looking for memory leaks with pointers and not references, so that perhaps leaves us with an issue as, in our current code, we allocate memory but don't actually delete it.
Now, technically, we haven't created a memory leak. Memory leaks appear when you allocate data and lose all of your references to it. Also, modern operating systems take care of deallocating a process's memory when our project is quit.
That's not to say that it's a good thing though. Depending on what information the Singleton class uses, we could have references to things that no longer exist at some point.
To have our object delete itself correctly, we need to destroy the Singleton when our game shuts down. The only ...
Read now
Unlock full access