Add an assert simplifying debugging.

Statics should not be deleted, the assert shows a nicer debug
information then a segmentation fault.

Change-Id: I9eedbfa966d7865fd7bb1e130c79e40bae3526cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Jędrzej Nowacki 2012-04-26 12:03:29 +02:00 committed by Qt by Nokia
parent 55024ee0f9
commit c68d8ca76c

View File

@ -112,6 +112,7 @@ void QArrayData::deallocate(QArrayData *data, size_t objectSize,
if (data == &qt_array_unsharable_empty)
return;
Q_ASSERT_X(!data->ref.isStatic(), "QArrayData::deallocate", "Static data can not be deleted");
::free(data);
}