[wasm-api] Memory house-keeping
This commit is contained in:
parent
f2d227ad9f
commit
b08026187a
|
@ -130,6 +130,8 @@ HB_WASM_API (bool_t, buffer_copy_contents) (HB_WASM_EXEC_ENV
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buffer_contents_free (exec_env, contentsptr);
|
||||||
|
|
||||||
contents->length = length;
|
contents->length = length;
|
||||||
contents->info = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->info, length * sizeof (buffer->info[0]));
|
contents->info = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->info, length * sizeof (buffer->info[0]));
|
||||||
contents->pos = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->pos, length * sizeof (buffer->pos[0]));
|
contents->pos = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->pos, length * sizeof (buffer->pos[0]));
|
||||||
|
|
|
@ -61,6 +61,8 @@ HB_WASM_API (bool_t, face_copy_table) (HB_WASM_EXEC_ENV
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
blob_free (exec_env, blobptr);
|
||||||
|
|
||||||
blob->length = length;
|
blob->length = length;
|
||||||
blob->data = wasm_runtime_module_dup_data (module_inst, hb_data, length);
|
blob->data = wasm_runtime_module_dup_data (module_inst, hb_data, length);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue