diff --git a/src/apps/soundrecorder/TrackSlider.cpp b/src/apps/soundrecorder/TrackSlider.cpp index 9cbb606906..8689e5d4e0 100644 --- a/src/apps/soundrecorder/TrackSlider.cpp +++ b/src/apps/soundrecorder/TrackSlider.cpp @@ -64,13 +64,14 @@ TrackSlider::AttachedToWindow() void TrackSlider::_InitBitmap() { - if (fBitmapView) { - fBitmap->RemoveChild(fBitmapView); - delete fBitmapView; - } - if (fBitmap) + if (fBitmap != NULL) { + if (fBitmapView != NULL) { + fBitmap->RemoveChild(fBitmapView); + delete fBitmapView; + } delete fBitmap; - + } + BRect rect = Bounds(); fBitmap = new BBitmap(rect, BScreen().ColorSpace(), true);