From 8871e94a1b81509bb0e44b331c7afda778b40e19 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Tue, 3 Dec 2024 18:37:08 +0300 Subject: [PATCH] Proper retain for any Val in args --- tpl/bhl_bind_macro.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tpl/bhl_bind_macro.twig b/tpl/bhl_bind_macro.twig index cc26094..6708b7c 100644 --- a/tpl/bhl_bind_macro.twig +++ b/tpl/bhl_bind_macro.twig @@ -448,7 +448,8 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack {%- macro val2native(type, value, native, is_arg = false) -%} {# any special case #} {%- if type == 'any' -%} - {{native}} = {{value}} + {{native}} = {{value}}; + {{native}}.Retain(); {%- else -%} {%~ if type is instanceof('\\mtgMetaFunc') -%}