We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
CowData::_unref()
1 parent 99f5a3d commit d2d5784Copy full SHA for d2d5784
core/templates/cowdata.h
@@ -282,6 +282,12 @@ void CowData<T>::_unref() {
282
283
// Free memory.
284
Memory::free_static((uint8_t *)prev_ptr - DATA_OFFSET, false);
285
+
286
+#ifdef DEBUG_ENABLED
287
+ // If any destructors access us through pointers, it is a bug.
288
+ // We can't really test for that, but we can at least check no items have been added.
289
+ ERR_FAIL_COND_MSG(_ptr != nullptr, "Internal bug, please report: CowData was modified during destruction.");
290
+#endif
291
}
292
293
template <typename T>
0 commit comments