* 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:
@@ -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)
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user