Closed yscoffee closed 6 years ago
I'm pretty sure SAFE_DELETE_ARRAY(data) should be correct. You certainly don't want to dereference your data ptr here...
in general, yes
but data in L568 points to a pointer not a data block, no ? safe-delete action will actually remove the pointer see loadFromBinaryMImage :
void loadFromBinaryMImage(const std::string& filename) {
loadBinaryMImage(filename, (void**) & m_data , m_width, m_height);
}
static void loadBinaryMImage(const std::string& filename, void** data, unsigned int& width, unsigned int& height) {
...
SAFE_DELETE_ARRAY(data);
*data = dataArray[0];
}
https://github.com/niessner/mLib/blob/7ca7eaaf8ea84ed6d959f654bf06e2e4cedebdee/include/core-base/baseImage.h#L568
looks this line should be SAFE_DELETE_ARRAY(data); =>SAFE_DELETE_ARRAY(*data);