Fix event handler memory leak (#2298)

* fix event handler memory leak and double drops

* Prevent double dropping generational boxes

* recycle instead of dropping
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-04-26 00:47:22 -04:00
1 parent a27d4e71ed
commit 47c87568e1
7 files changed
+182 -54

No files matched your search

+2 -1
View File
@@ -163,7 +163,8 @@ impl AnyStorage for UnsyncStorage {
}
fn recycle(location: &MemoryLocation<Self>) {
let location = *location;
location.drop();
UNSYNC_RUNTIME.with(|runtime| runtime.borrow_mut().push(*location));
UNSYNC_RUNTIME.with(|runtime| runtime.borrow_mut().push(location));
}
}