-
-
Notifications
You must be signed in to change notification settings - Fork 496
Fix mem leak in LuaManager #1066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is a critical leak :)
Thank you for the fix!
I'm just curious to understand how https://github.com/multitheftauto/mtasa-blue/blob/master/Client/mods/deathmatch/logic/CClientGame.cpp#L1126 fails to free the memory in this case. I'm not exactly sure as to how the pulses work, but isn't ProcessPendingDeleteList() getting called? Do you have some stats that can show how significant the memory leak is as you're describing it to be "critical"? I suppose it makes sense to call the function in destructor though...
Leaving a server deletes CClientGame including CLuaManager. You don't run the pulse anymore to clean up afterwards.
Leaving a server deletes CClientGame including CLuaManager. You don't run the pulse anymore to clean up afterwards.
Ok, we should cross check for other missing cleanups elsewhere too.
I suppose it makes sense to call the function in destructor though...
This is exactly what was done.
Do you have some stats that can show how significant the memory leak is as you're describing it to be "critical"?
In the discord channel, I send screenshots showing a leak when disconnecting (reconnecting) and when restarting resources (when the player is on the server).
I don't see any reason not to merge this pull request and I have tested it. Thanks for the work.
Copied from @pentaflops' messages on Discord
before
after
Before the fix, the game crashed after 5 reconnections to the server. Now this is not observed (if you do not take into account the memory leak RW).
After disconnecting from the server, the CLuaManager should cleanup LuaVM, but does not
With love from NEXTRP Team