Add an assert simplifying debugging.
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>
Thu, 26 Apr 2012 10:03:29 +0000 (12:03 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 4 May 2012 13:24:52 +0000 (15:24 +0200)
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>
src/corelib/tools/qarraydata.cpp

index 328d39c..42b5741 100644 (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);
 }