Fix: memory leak on listeners for elements (#2244)

* Fix: memory leak on listeners for elements
* Recycle in manuallydrop

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
This commit is contained in:
Jonathan KelleyandEvan Almloff authored and GitHub committed 2024-04-04 14:25:17 -07:00
1 parent 6f3c5518ca
commit 44fe2defc2
3 files changed
+27 -2

No files matched your search

+1
View File
@@ -189,6 +189,7 @@ impl<T, S: Storage<T>> GenerationalBox<T, S> {
/// Drop the value out of the generational box and invalidate the generational box. This will return the value if the value was taken.
pub fn manually_drop(&self) -> Option<T> {
if self.validate() {
<S as AnyStorage>::recycle(&self.raw);
Storage::take(&self.raw.0.data)
} else {
None