fix memory leak
This commit is contained in:
1 parent
c5f003e41e
commit
00a9ad29a8
1 file changed
+9
@@ -73,6 +73,15 @@ pub(crate) struct ScopeSlab {
|
|||||||
entries: Slab<Slot<'static, ScopeState>>,
|
entries: Slab<Slot<'static, ScopeState>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Drop for ScopeSlab {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
// Bump slab doesn't drop its contents, so we need to do it manually
|
||||||
|
for slot in self.entries.drain() {
|
||||||
|
self.slab.remove(slot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Default for ScopeSlab {
|
impl Default for ScopeSlab {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
Reference in new issue
Block a user