mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 18:20:51 +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:
parent
86d1ab513b
commit
2972599ee3
@ -650,11 +650,9 @@ impl<'a> Context<'a> {
|
||||
dst.push_str(&format!(
|
||||
"
|
||||
free() {{
|
||||
if (this.ptr === 0)
|
||||
return;
|
||||
const ptr = this.ptr;
|
||||
this.ptr = 0;
|
||||
free{}(this.ptr);
|
||||
free{}(ptr);
|
||||
}}
|
||||
",
|
||||
name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user