Update to callback function:
delete memory also in the eno structure do not close a file twice
This commit is contained in:
parent
7e611e7b57
commit
c891c2f64f
|
|
@ -299,12 +299,11 @@ cm_table2D_callback(ARGS, Mif_Callback_Reason_t reason)
|
|||
case MIF_CB_DESTROY: {
|
||||
int i;
|
||||
Local_Data_t *loc = STATIC_VAR (locdata);
|
||||
if (loc->state->fp)
|
||||
fclose(loc->state->fp);
|
||||
free(loc->state);
|
||||
for (i = 0; i < loc->iy; i++)
|
||||
free(loc->table[i]);
|
||||
free(loc->table);
|
||||
sf_eno2_close (loc->newtable);
|
||||
free(loc);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -305,8 +305,6 @@ cm_table3D_callback(ARGS, Mif_Callback_Reason_t reason)
|
|||
case MIF_CB_DESTROY: {
|
||||
int i, j;
|
||||
Local_Data_t *loc = STATIC_VAR (locdata);
|
||||
if (loc->state->fp)
|
||||
fclose(loc->state->fp);
|
||||
free(loc->state);
|
||||
|
||||
for (i = 0; i < loc->iz; i++) {
|
||||
|
|
@ -315,6 +313,7 @@ cm_table3D_callback(ARGS, Mif_Callback_Reason_t reason)
|
|||
free(loc->table[i]);
|
||||
}
|
||||
free(loc->table);
|
||||
sf_eno3_close (loc->newtable);
|
||||
free(loc);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue