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

SQVM::PopGet() leaves lingering object references #287

Open
samisalreadytaken opened this issue May 6, 2024 · 0 comments
Open

SQVM::PopGet() leaves lingering object references #287

samisalreadytaken opened this issue May 6, 2024 · 0 comments

Comments

@samisalreadytaken
Copy link

SQVM::PopGet() does not clear stack position, leaving lingering objects in the stack until either that position is overwritten or the VM is killed. This can cause unexpected behaviour in code that relies on it.

It should probably behave like Top(); Pop(); as its name suggests, nullifying the stack position.

SQObjectPtr &SQVM::PopGet() { return _stack[--_top]; }

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

No branches or pull requests

1 participant