mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
Merge pull request #61003 from vnen/gdscript-await-stack-fix
This commit is contained in:
commit
c41f62c3df
2 changed files with 30 additions and 34 deletions
|
@ -279,7 +279,8 @@ Variant GDScriptFunctionState::resume(const Variant &p_arg) {
|
|||
void GDScriptFunctionState::_clear_stack() {
|
||||
if (state.stack_size) {
|
||||
Variant *stack = (Variant *)state.stack.ptr();
|
||||
for (int i = 0; i < state.stack_size; i++) {
|
||||
// The first 3 are special addresses and not copied to the state, so we skip them here.
|
||||
for (int i = 3; i < state.stack_size; i++) {
|
||||
stack[i].~Variant();
|
||||
}
|
||||
state.stack_size = 0;
|
||||
|
@ -300,8 +301,6 @@ GDScriptFunctionState::GDScriptFunctionState() :
|
|||
}
|
||||
|
||||
GDScriptFunctionState::~GDScriptFunctionState() {
|
||||
_clear_stack();
|
||||
|
||||
{
|
||||
MutexLock lock(GDScriptLanguage::singleton->lock);
|
||||
scripts_list.remove_from_list();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue