Fix Closure::forget

It forgot to actually forget the contents!
This commit is contained in:
Alex Crichton 2018-10-01 15:37:15 -07:00
parent 9c085dc0f5
commit 727e0a7154

View File

@ -232,10 +232,8 @@ impl<T> Closure<T>
/// cleanup as it can. /// cleanup as it can.
pub fn forget(self) { pub fn forget(self) {
unsafe { unsafe {
let idx = self.js.idx; super::__wbindgen_cb_forget(self.js.idx);
if idx != !0 { mem::forget(self);
super::__wbindgen_cb_forget(idx);
}
} }
} }
} }