From 75d26e104abe3f0e677dd83c34141806c842e039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 14 Jun 2005 00:38:21 +0000 Subject: [PATCH] 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 --- src/servers/app/ServerBitmap.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/servers/app/ServerBitmap.cpp b/src/servers/app/ServerBitmap.cpp index a80d82a218..9e6cbf9d1e 100644 --- a/src/servers/app/ServerBitmap.cpp +++ b/src/servers/app/ServerBitmap.cpp @@ -24,6 +24,8 @@ // Description: Bitmap class used by the server // //------------------------------------------------------------------------------ +#include + #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; } /*!