-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix onNetworkMessage event memory leak #4887
base: master
Are you sure you want to change the base?
Conversation
In the best-case scenario, Lua will clean up the object; in the worst-case scenario, there will be a memory leak. That is correct—thank you for catching this issue. However, I would prefer if you made some adjustments to the code.
Please do not forget to use CCLANG format, so we can merge it. |
You are right, anyway you can not pass a mutable lambda to the Although you can still pass by reference to the method |
Pull Request Prelude
Issues addressed:
Fix memory leak
How to test:
Disable Player:onNetworkMessage event and send packets with unknown opcode to server, such as from store.