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()
{
Stop();
delete fDestImage;
}

View File

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

View File

@ -110,6 +110,7 @@ private:
void AnimateSelection(bool a);
void Notify(const char* status);
void AddToRecentDocuments();
void DeleteScaler();
void DeleteBitmap();
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);