I’m getting a memory leak in iOS when I use a vector of vectors of floats in a C++ object.
In my object’s declaration:
class object {
// ...
vector< vector < float > > m_vBuffers;
}
and in the constructor:
m_vBuffers.resize( uNumBuffers );
for( uint iBuf= 0; iBuf < uNumBuffers; ++iBuf )
m_vBuffers[iBuf].resize( uMaxLength );
Now, instruments shows me a leak in the constructor on the resize operation. How can I fix this?
(Also, I thought vectors of vectors of non-pointers didn’t have to be explicitly deleted? Is that wrong?)
Yes, this was in fact a problem with the destruction of my object, not of the vector. I wasn’t thinking about the Instruments stack trace properly.