mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-29 23:50:20 +00:00
Merge pull request #152 from DioxusLabs/jk/drop-order-tweak
tweak: drop hooks before resetting bump arena
This commit is contained in:
commit
508f7e9c40
1 changed files with 4 additions and 2 deletions
|
@ -891,13 +891,15 @@ impl ScopeState {
|
||||||
self.frames[0].reset();
|
self.frames[0].reset();
|
||||||
self.frames[1].reset();
|
self.frames[1].reset();
|
||||||
|
|
||||||
// Finally, free up the hook values
|
// Free up the hook values
|
||||||
self.hook_arena.reset();
|
|
||||||
self.hook_vals.get_mut().drain(..).for_each(|state| {
|
self.hook_vals.get_mut().drain(..).for_each(|state| {
|
||||||
let as_mut = unsafe { &mut *state };
|
let as_mut = unsafe { &mut *state };
|
||||||
let boxed = unsafe { bumpalo::boxed::Box::from_raw(as_mut) };
|
let boxed = unsafe { bumpalo::boxed::Box::from_raw(as_mut) };
|
||||||
drop(boxed);
|
drop(boxed);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Finally, clear the hook arena
|
||||||
|
self.hook_arena.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue