Skip to content

Commit d9acd1b

Browse files
committed
Only free r-array of statuses if not ignore
1 parent df1150f commit d9acd1b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/resources/generator_data/code/C/templates/in_functions.jinja

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
{%- if arg['arg_dep']|default("") != "" -%}
4646
{%- if map['max_mpi']|default("") == "" or map['type']!='char *' %}
4747
{%- if map['type'] == 'MPI_Status'-%}
48-
wi4mpi_free(array_of_statuses_tmp);
48+
if (array_of_statuses != A_MPI_STATUSES_IGNORE) {
49+
wi4mpi_free(array_of_statuses_tmp);
50+
}
4951
{%- else-%}
5052
wi4mpi_free({{var|replace('[]','')}}_tmp);
5153
{%- endif-%}

src/resources/generator_data/code/fortran/templates/in_functions.jinja

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
{% if map['no_map']|default("") == "" -%}
5353
{%- if 'status_size' in map -%}
5454
{%- if 'arg_dep' in arg and arg['arg_dep'] != '' -%}
55-
wi4mpi_free({{var}}_tmp);
55+
if ({{var}} != A_f_MPI_STATUSES_IGNORE) {
56+
wi4mpi_free({{var}}_tmp);
57+
}
5658
{%- endif -%}
5759
{%- else -%}
5860
{%- if 'arg_dep' in arg and arg['arg_dep']!='' -%}

0 commit comments

Comments
 (0)