-
Notifications
You must be signed in to change notification settings - Fork 4
Memory Leaking Problems #19
Comments
I can imagine. PRs are welcome. |
zcatch/src/game/server/gamemodes/zcatch.cpp Line 429 in 9adb5b0
zcatch/src/game/server/gamecontext.h Line 95 in 9adb5b0
zcatch/src/game/server/gamecontext.h Line 241 in 9adb5b0
zcatch/src/game/server/gamecontext.cpp Lines 75 to 99 in 9adb5b0
I think it should be possible to somehow delete the allocated memory of the threads before the destruction of the actual GameContext. It's possible to spam "/top", which spawns endless threads, which are already finished executing, but the thread handles are still in memory. |
The solution would be to remove the vector, the AddRankingThread() function and replace every usage of said function with and delete the part in the destructor. |
Put this into Tick and in either OnShutDown or in the Destructor:
Detached threads are hard to control, thus better keep joining them every 5 seconds, when they are done writing to the DB. |
Some commands, even player accessible ones like /top seem to cause memory leaks. Something seems not to be cleaned.
Also some free() function calls seem to be weirdly placed in the ranking system functions.
The text was updated successfully, but these errors were encountered: