A bit tuning Dispose
Publish PHP Package / docker (push) Successful in 5s Details

This commit is contained in:
Pavel Shevaev 2024-11-14 20:56:38 +03:00
parent ae057fecec
commit 5f9d155d1f
1 changed files with 6 additions and 8 deletions

View File

@ -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 -%}