I am building a multiplayer game in Java using Java sockets for a university project, and I've reached the point where it's playable, but I am not sure how to release resources after the game ends.
The server should be able to support multiple simultaneous matches, so everytime a new game starts, it's assigned its own thread, which then generates all objects used for game logic. Aside from closing sockets and input/output streams, will terminating the main thread (as in "reaching the end of the run method") mark all objects I use for game logic for garbage collection, or do I have to delete references one by one to avoid memory leaks?
From what I've read, my assumption is correct, and what I need to check is whether all objects I create are actually only referenced by the main thread