we've a class, holding some core::stringw properties. When the system (iOS) calls the destructor, it sometimes crashes because the following code tries to free memory space, that hasn't been allocated yet.
1. Class destructor calls iiString.cpp ~string() destructor
Code: Select all
//! Destructor
~string()
{
allocator.deallocate(array); // delete [] array;
}
Code: Select all
//! Deallocate memory for an array of objects
void deallocate(T* ptr)
{
internal_delete(ptr);
}
Code: Select all
virtual void internal_delete(void* ptr)
{
operator delete(ptr); // malloc: *** error for object 0x170817650: pointer being freed was not allocated
}
Regards,
Daniel