Skip to content

Commit

Permalink
Fixed ref leak caused by %f%({}) or similar where f is an object.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexikos committed Feb 17, 2012
1 parent 7c28650 commit 1821e33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/script_expression.cpp
Expand Up @@ -386,7 +386,10 @@ LPTSTR Line::ExpandExpression(int aArgIndex, ResultType &aResult, ExprTokenType
// That is, each extra (SYM_OPAREN, SYM_COMMA or SYM_CPAREN) token in infix
// effectively reserves one stack slot.
if (actual_param_count)
{
memmove(params + 1, params, actual_param_count * sizeof(ExprTokenType *));
high_water_mark++; // If this isn't done and the last param is an object, it won't be released.
}
// Insert an empty string:
params[0] = (ExprTokenType *)_alloca(sizeof(ExprTokenType));
params[0]->symbol = SYM_STRING;
Expand Down

0 comments on commit 1821e33

Please sign in to comment.