mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-23 17:51:33 +00:00
Fix some mistakes from WeakRef
support
* Be sure to free the pointer, not `this.ptr` which is always 0 * Unconditionally attempt to free data and let Rust throw an exception if it's null
This commit is contained in:
@ -650,11 +650,9 @@ impl<'a> Context<'a> {
|
|||||||
dst.push_str(&format!(
|
dst.push_str(&format!(
|
||||||
"
|
"
|
||||||
free() {{
|
free() {{
|
||||||
if (this.ptr === 0)
|
|
||||||
return;
|
|
||||||
const ptr = this.ptr;
|
const ptr = this.ptr;
|
||||||
this.ptr = 0;
|
this.ptr = 0;
|
||||||
free{}(this.ptr);
|
free{}(ptr);
|
||||||
}}
|
}}
|
||||||
",
|
",
|
||||||
name,
|
name,
|
||||||
|
Reference in New Issue
Block a user