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
This commit is contained in:
Matthew Wilber 2003-07-19 04:13:12 +00:00
parent fc54fa7117
commit 374c8f77d5
1 changed files with 4 additions and 3 deletions

View File

@ -444,13 +444,14 @@ ImageView::SetImage(BMessage *pmsg)
B_TRANSLATOR_BITMAP); B_TRANSLATOR_BITMAP);
BBitmap *pbitmap = NULL; BBitmap *pbitmap = NULL;
chk = outstream.DetachBitmap(&pbitmap); chk = outstream.DetachBitmap(&pbitmap);
delete fpbitmap;
fpbitmap = pbitmap; fpbitmap = pbitmap;
pbitmap = NULL; pbitmap = NULL;
fcurrentRef = ref; 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; int32 documentCount = 0;
if (ioExtension.FindInt32("/documentCount", &documentCount) == if (ioExtension.FindInt32("/documentCount", &documentCount) == B_OK &&
B_OK && documentCount > 0) documentCount > 0)
fdocumentCount = documentCount; fdocumentCount = documentCount;
else else
fdocumentCount = 1; fdocumentCount = 1;