BShape: Fix issues for debug build.
As part of the refactoring that was done for app_server layer support, the private shape_data struct was updated to derive from BReferenceable. However, BShape's destructor was never updated to reflect this, and consequently attempts to use a debug build of libbe would consistently throw the user into the debugger due to BReferenceable's sanity check against non-zero deletes that weren't on the stack. It should be noted though that there are probably a few things that could be factored out and/or simplified with that class in general, since e.g. when copying its data from another shape_data instance, it uses C++ array allocations, while when being manipulated by BShape directly, the latter uses alloc/realloc/free.
This commit is contained in:
@@ -183,11 +183,12 @@ BShape::BShape(BMessage* archive)
|
||||
BShape::~BShape()
|
||||
{
|
||||
shape_data* data = (shape_data*)fPrivateData;
|
||||
if (!data->fOwnsMemory) {
|
||||
free(data->opList);
|
||||
free(data->ptList);
|
||||
}
|
||||
|
||||
free(data->opList);
|
||||
free(data->ptList);
|
||||
|
||||
delete (shape_data*)fPrivateData;
|
||||
data->ReleaseReference();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user