From 374c8f77d57b138a07d5a4957be02b88123babf8 Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Sat, 19 Jul 2003 04:13:12 +0000 Subject: [PATCH] resolved memory leak which occured everytime the user switched pages or opened a new image git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4013 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tools/translation/inspector/ImageView.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tools/translation/inspector/ImageView.cpp b/src/tools/translation/inspector/ImageView.cpp index 2cd7be2a75..b6c58943ff 100644 --- a/src/tools/translation/inspector/ImageView.cpp +++ b/src/tools/translation/inspector/ImageView.cpp @@ -444,13 +444,14 @@ ImageView::SetImage(BMessage *pmsg) B_TRANSLATOR_BITMAP); BBitmap *pbitmap = NULL; chk = outstream.DetachBitmap(&pbitmap); + delete fpbitmap; fpbitmap = pbitmap; pbitmap = NULL; fcurrentRef = ref; - // need to keep the ref around if user was to switch pages + // need to keep the ref around if user wants to switch pages int32 documentCount = 0; - if (ioExtension.FindInt32("/documentCount", &documentCount) == - B_OK && documentCount > 0) + if (ioExtension.FindInt32("/documentCount", &documentCount) == B_OK && + documentCount > 0) fdocumentCount = documentCount; else fdocumentCount = 1;