mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-15 01:18:13 +00:00
[wasm-api] Memory house-keeping
This commit is contained in:
parent
f2d227ad9f
commit
b08026187a
2 changed files with 4 additions and 0 deletions
|
@ -130,6 +130,8 @@ HB_WASM_API (bool_t, buffer_copy_contents) (HB_WASM_EXEC_ENV
|
|||
return true;
|
||||
}
|
||||
|
||||
buffer_contents_free (exec_env, contentsptr);
|
||||
|
||||
contents->length = length;
|
||||
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]));
|
||||
|
|
|
@ -61,6 +61,8 @@ HB_WASM_API (bool_t, face_copy_table) (HB_WASM_EXEC_ENV
|
|||
return true;
|
||||
}
|
||||
|
||||
blob_free (exec_env, blobptr);
|
||||
|
||||
blob->length = length;
|
||||
blob->data = wasm_runtime_module_dup_data (module_inst, hb_data, length);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue