Here's the code:
@interface myClass {
std::vector<float> myVector
}
@end
It's leaking according to instruments. Here's the stack trace:
1 libstdc++.6.dylib operator new(unsigned long)
2 __gnu_cxx::new_allocator<float>::allocate(unsigned long, void const*)
3 std::_Vector_base<float, std::allocator<float> >::_M_allocate(unsigned long)
I'm guessing I should be allocating the vector on the heap, but I still don't understand why this occurs. It's also possible I'm failing to dealloc the class properly.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…