albertodemichelis/squirrel

`SQVM::PopGet()` leaves lingering object references

Opened this issue · 0 comments

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]; }