fInitialized is also set in the copy constructor. BTW, the Haiku Logo is displayed now (forgot to commit this earlier). Thanks to Axel for finding out about this.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13110 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6262418e6a
commit
75d26e104a
@ -24,6 +24,8 @@
|
||||
// Description: Bitmap class used by the server
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
#include <new>
|
||||
|
||||
#include "ServerBitmap.h"
|
||||
|
||||
/*!
|
||||
@ -66,6 +68,7 @@ ServerBitmap::ServerBitmap(const ServerBitmap* bmp)
|
||||
// TODO: what about fToken and fOffset ?!?
|
||||
{
|
||||
if (bmp) {
|
||||
fInitialized = bmp->fInitialized;
|
||||
fWidth = bmp->fWidth;
|
||||
fHeight = bmp->fHeight;
|
||||
fBytesPerRow = bmp->fBytesPerRow;
|
||||
@ -103,14 +106,8 @@ ServerBitmap::_AllocateBuffer(void)
|
||||
uint32 length = BitsLength();
|
||||
if (length > 0) {
|
||||
delete[] fBuffer;
|
||||
try {
|
||||
fBuffer = new uint8[length];
|
||||
fInitialized = true;
|
||||
} catch (...) {
|
||||
// we can't do anything about it
|
||||
fBuffer = NULL;
|
||||
fInitialized = false;
|
||||
}
|
||||
fBuffer = new(nothrow) uint8[length];
|
||||
fInitialized = fBuffer != NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,6 +121,7 @@ ServerBitmap::_FreeBuffer(void)
|
||||
{
|
||||
delete[] fBuffer;
|
||||
fBuffer = NULL;
|
||||
fInitialized = false;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
Reference in New Issue
Block a user