core::string destructor is crashing
Posted: Tue Apr 04, 2017 8:42 am
Hi there,
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
2. ... calls irrAllocator.h deallocate(T * ptr)
3. ... calls irrAllocator.h internal_delete(void* ptr)
Can anybody tell me, how to solve this issue?
Regards,
Daniel
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