Skip to content

Commit 3a29d23

Browse files
moulinskjarosh
authored andcommitted
core: properly free memory in BitmapData::dispose
`Vec::clear` doesn't actually free the backing memory, so replace with an empty vec instead.
1 parent 763616d commit 3a29d23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/bitmap/bitmap_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ impl<'gc> BitmapData<'gc> {
608608
pub fn dispose(&mut self) {
609609
self.width = 0;
610610
self.height = 0;
611-
self.pixels.clear();
611+
self.pixels = Vec::new(); // free the CPU pixel buffer
612612
self.bitmap_handle = None;
613613
// There's no longer a handle to update
614614
self.dirty_state = DirtyState::Clean;

0 commit comments

Comments
 (0)