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:
parent
fc54fa7117
commit
374c8f77d5
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user