-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Smart all the Things! #5022
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
Smart all the Things! #5022
Conversation
Co-authored-by: ramon-bernardo <[email protected]>
Co-authored-by: ramon-bernardo <[email protected]>
…ameter Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Rename loop variable to avoid parameter shadowing
…, remove fail-fast Co-authored-by: ranisalt <[email protected]>
Co-authored-by: ranisalt <[email protected]>
Co-authored-by: ranisalt <[email protected]>
Refactor code per PR #11 review feedback
Use weak_ptr for non-owning attributes
| g_game.browseFields.erase(getTile()); | ||
|
|
||
| for (Item* item : itemlist) { | ||
| const auto& parent = getParent(); |
Check warning
Code scanning / CodeQL
Virtual call from constructor or destructor
ramon-bernardo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some fixes
|
Close #2238 |
Co-authored-by: Ramon Bernardo <[email protected]>
|
@ranisalt |
|
@gesior the branch is ready to be tested and the server is (seems to be) working properly |
|
I am daily running some tests while I test systems that I am working on in parallel, everything seems to be working perfectly |
|
As soon as I have a reasonably good amount of time, I will check all the changes and try to find possible parts of the code that still need to be adapted |
|
I tried my best |
Pull Request Prelude
Changes Proposed
This pull request introduces several changes to the code in order to migrate
Thingand it's derived classes to usestd::shared_ptrand to remove ofCylinderas an utility class. These updates improve memory safety and potentially fix multiple dangling pointers and memory leaks.Note: according to basic testing, memory usage increases by about 30% using the default map (138 MB vs 179 MB). Still need to benchmark against a larger map to grab better numbers.
Also, the commits and files tabs are massive, don't try to open them in a slow computer 😅
Co-authored-by: @ramon-bernardo
Issues addressed:
Fixes #2238
Fixes #2260
Fixes #2682
Fixes #3552
Fixes #4752
Fixes #4961
Closes #2193
Closes #2219
Closes #5019
(needs to be confirmed)
How to test:
Just run the server, everything should be unchanged from the client perspective.