* small cleanup, added comment about out of memory condition

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22126 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2007-08-30 22:31:55 +00:00
parent afa1b9a59c
commit caacab3726
+5 -2
View File
@@ -66,7 +66,8 @@ BRegion::BRegion(const BRect rect)
// NOTE: private constructor // NOTE: private constructor
/*! \brief Initializes a region to contain a clipping_rect. /*! \brief Initializes a region to contain a clipping_rect.
\param rect The BRect to set the region to. \param rect The clipping_rect to set the region to, already in
internal rect format.
*/ */
BRegion::BRegion(const clipping_rect& rect) BRegion::BRegion(const clipping_rect& rect)
: fCount(1) : fCount(1)
@@ -310,7 +311,7 @@ BRegion::OffsetBy(int32 x, int32 y)
void void
BRegion::MakeEmpty() BRegion::MakeEmpty()
{ {
fBounds= (clipping_rect){ 0, 0, 0, 0 }; fBounds = (clipping_rect){ 0, 0, 0, 0 };
fCount = 0; fCount = 0;
} }
@@ -475,6 +476,8 @@ BRegion::_SetSize(long newSize)
clipping_rect* resizedData = (clipping_rect*)realloc(fData, clipping_rect* resizedData = (clipping_rect*)realloc(fData,
newSize * sizeof(clipping_rect)); newSize * sizeof(clipping_rect));
if (!resizedData) { if (!resizedData) {
// failed to resize, but we cannot keep the
// previous state of the object
free(fData); free(fData);
fData = NULL; fData = NULL;
} else } else