Bug fixed: virtual function must not be called in destructor.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5352 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Pfeiffer 2003-11-13 20:38:19 +00:00
parent 70a5b6f894
commit 50d78f98e5
3 changed files with 12 additions and 5 deletions

View File

@ -42,7 +42,6 @@ Filter::Filter(BBitmap* image, BMessenger listener, uint32 what)
Filter::~Filter() Filter::~Filter()
{ {
Stop();
delete fDestImage; delete fDestImage;
} }

View File

@ -226,12 +226,19 @@ ShowImageView::AddToRecentDocuments()
} }
void void
ShowImageView::DeleteBitmap() ShowImageView::DeleteScaler()
{ {
if (fScaler) { if (fScaler) {
fScaler->Stop();
delete fScaler; delete fScaler;
fScaler = NULL; fScaler = NULL;
} }
}
void
ShowImageView::DeleteBitmap()
{
DeleteScaler();
delete fpBitmap; delete fpBitmap;
fpBitmap = NULL; fpBitmap = NULL;
} }
@ -535,7 +542,7 @@ Scaler*
ShowImageView::GetScaler() ShowImageView::GetScaler()
{ {
if (fScaler == NULL || fScaler->Scale() != fZoom) { if (fScaler == NULL || fScaler->Scale() != fZoom) {
delete fScaler; DeleteScaler();
BMessenger msgr(this, Window()); BMessenger msgr(this, Window());
fScaler = new Scaler(fpBitmap, fZoom, msgr, MSG_INVALIDATE); fScaler = new Scaler(fpBitmap, fZoom, msgr, MSG_INVALIDATE);
fScaler->Start(); fScaler->Start();
@ -1334,7 +1341,7 @@ void
ShowImageView::SetZoom(float zoom) ShowImageView::SetZoom(float zoom)
{ {
if (fScaleBilinear && fZoom != zoom) { if (fScaleBilinear && fZoom != zoom) {
delete fScaler; fScaler = NULL; DeleteScaler();
} }
fZoom = zoom; fZoom = zoom;
FixupScrollBars(); FixupScrollBars();

View File

@ -110,6 +110,7 @@ private:
void AnimateSelection(bool a); void AnimateSelection(bool a);
void Notify(const char* status); void Notify(const char* status);
void AddToRecentDocuments(); void AddToRecentDocuments();
void DeleteScaler();
void DeleteBitmap(); void DeleteBitmap();
int32 BytesPerPixel(color_space cs) const; int32 BytesPerPixel(color_space cs) const;
inline void CopyPixel(uchar* dest, int32 destX, int32 destY, int32 destBPR, uchar* src, int32 x, int32 y, int32 bpr, int32 bpp); inline void CopyPixel(uchar* dest, int32 destX, int32 destY, int32 destBPR, uchar* src, int32 x, int32 y, int32 bpr, int32 bpp);