Skip to content

Commit 2f188e7

Browse files
authored
evaluator: Clear template arguments at the beginning of evaluations (WerWolv#210)
As template arguments might contain references to local sections where the reference count is cleared at the beginning of the evaluation.
1 parent a880ae0 commit 2f188e7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/source/pl/core/evaluator.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,14 +944,19 @@ namespace pl::core {
944944
this->m_scopes.clear();
945945
this->m_callStack.clear();
946946
this->m_heap.clear();
947-
this->m_patternLocalStorage.clear();
947+
948948
this->m_templateParameters.clear();
949+
this->m_currentTemplateArguments.clear();
950+
this->m_typeTemplateParameters.clear();
951+
this->m_attributedPatterns.clear();
952+
953+
this->m_patternLocalStorage.clear();
954+
949955
this->m_stringPool.clear();
950956

951957
this->m_mainResult.reset();
952958
this->m_aborted = false;
953959
this->m_evaluated = false;
954-
this->m_attributedPatterns.clear();
955960

956961
this->setPatternColorPalette(DefaultPatternColorPalette);
957962

0 commit comments

Comments
 (0)