diff --git a/tpl/bhl_bind_macro.twig b/tpl/bhl_bind_macro.twig index 59c10eb..2e8e87b 100644 --- a/tpl/bhl_bind_macro.twig +++ b/tpl/bhl_bind_macro.twig @@ -363,25 +363,23 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack {%- for arg in o.args -%} {% if arg.type is instanceof('\\mtgArrType') %} {% if arg.type.value.name == 'any' %} - { - {{arg_prefix}}{{arg.name}}?.Release(); - {{arg_prefix}}{{arg.name}} = null; - } + {{arg_prefix}}{{arg.name}}?.Release(); + {{arg_prefix}}{{arg.name}} = default; {% else %} { if({{arg_prefix}}{{arg.name}} is IDisposable dsp) - { dsp.Dispose(); - {{arg_prefix}}{{arg.name}} = default; - } + {{arg_prefix}}{{arg.name}} = default; } {% endif %} {% endif %} {% if arg.type.name == 'any' %} - {{arg_prefix}}{{arg.name}}?.Release(); + {{arg_prefix}}{{arg.name}}?.Release(); + {{arg_prefix}}{{arg.name}} = default; {% endif %} + {%- endfor ~%} {%- endmacro -%}