Skip to content

Conversation

@ranisalt
Copy link
Member

@ranisalt ranisalt commented Nov 3, 2025

Pull Request Prelude

Changes Proposed

This pull request introduces several changes to the code in order to migrate Thing and it's derived classes to use std::shared_ptr and to remove of Cylinder as 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.

ranisalt and others added 30 commits November 3, 2025 20:55
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>
g_game.browseFields.erase(getTile());

for (Item* item : itemlist) {
const auto& parent = getParent();

Check warning

Code scanning / CodeQL

Virtual call from constructor or destructor

Call to virtual function [getParent](1) which is overridden in [DepotChest](2). If you intend to statically call this virtual function, it should be qualified with Thing::. Call to virtual function [getParent](1) which is overridden in [Inbox](3). If you intend to statically call this virtual function, it should be qualified with Thing::.
Copy link
Contributor

@ramon-bernardo ramon-bernardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some fixes

@ramon-bernardo
Copy link
Contributor

Close #2238

Co-authored-by: Ramon Bernardo <[email protected]>
@gesior
Copy link
Contributor

gesior commented Nov 13, 2025

@ranisalt
Is it ready for testing yet, or are you still working on some issues?

@ranisalt
Copy link
Member Author

@gesior the branch is ready to be tested and the server is (seems to be) working properly

@alysonjacomin
Copy link
Contributor

I am daily running some tests while I test systems that I am working on in parallel, everything seems to be working perfectly

@alysonjacomin
Copy link
Contributor

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

@ranisalt
Copy link
Member Author

ranisalt commented Dec 7, 2025

I tried my best

@ranisalt ranisalt closed this Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Increase or improvement in quality, value, or extent needs-testing Needs testing with screenshots

Projects

None yet

6 participants