Skip to content
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: depotchest memory leak #4510

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix: depotchest memory leak #4510

wants to merge 2 commits into from

Conversation

lyuz1n
Copy link
Contributor

@lyuz1n lyuz1n commented Jul 23, 2023

Pull Request Prelude

Changes Proposed

items on depot cannot destroy after player logout.
after some relogins with around 100k items on depot...

BEFORE FIX:
Captura de tela 2023-07-23 164438

AFTER FIX:
Captura de tela 2023-07-23 164420

@nekiro
Copy link
Member

nekiro commented Jul 23, 2023

#3423
#3452

src/player.h Outdated Show resolved Hide resolved
Copy link
Contributor

@moviebr moviebr left a comment

Choose a reason for hiding this comment

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

Nice :)

Copy link
Member

@nekiro nekiro left a comment

Choose a reason for hiding this comment

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

This will crash, because of double pointer deletion, one happens from container destructor, because depot is a regular item inside locker (you have to remove depot from locker on player destructor to avoid that) and the second will trigger from shared_ptr trying to delete assigned object

@ranisalt
Copy link
Member

@nekiro is right, if you're going to change to a shared ptr, you must change it everywhere or you will get nasty double frees

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants