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:
Stephan Aßmus
2005-06-14 00:38:21 +00:00
parent 6262418e6a
commit 75d26e104a
+6 -8
View File
@@ -24,6 +24,8 @@
// Description: Bitmap class used by the server // Description: Bitmap class used by the server
// //
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#include <new>
#include "ServerBitmap.h" #include "ServerBitmap.h"
/*! /*!
@@ -66,6 +68,7 @@ ServerBitmap::ServerBitmap(const ServerBitmap* bmp)
// TODO: what about fToken and fOffset ?!? // TODO: what about fToken and fOffset ?!?
{ {
if (bmp) { if (bmp) {
fInitialized = bmp->fInitialized;
fWidth = bmp->fWidth; fWidth = bmp->fWidth;
fHeight = bmp->fHeight; fHeight = bmp->fHeight;
fBytesPerRow = bmp->fBytesPerRow; fBytesPerRow = bmp->fBytesPerRow;
@@ -103,14 +106,8 @@ ServerBitmap::_AllocateBuffer(void)
uint32 length = BitsLength(); uint32 length = BitsLength();
if (length > 0) { if (length > 0) {
delete[] fBuffer; delete[] fBuffer;
try { fBuffer = new(nothrow) uint8[length];
fBuffer = new uint8[length]; fInitialized = fBuffer != NULL;
fInitialized = true;
} catch (...) {
// we can't do anything about it
fBuffer = NULL;
fInitialized = false;
}
} }
} }
@@ -124,6 +121,7 @@ ServerBitmap::_FreeBuffer(void)
{ {
delete[] fBuffer; delete[] fBuffer;
fBuffer = NULL; fBuffer = NULL;
fInitialized = false;
} }
/*! /*!