I am currently in C ++ for a lower level of coding with opengl. I come from the heavy background of objc, so I have some understanding of memory management, but I can't figure out how the boost library handles container types like ptr_vector.
I think my problem is that I donβt know how it ptr_vectorcontrols the destruction of itself and its objects.
Please take a look at the following code:
...
ptr_vector<IObject3D> objects;
...
...
void ApplicationEngine::init()
{
WavefrontObject3D *object = new WavefrontObject3D("Ninja.obj");
objects.push_back(object);
}
...
So, for the actual question : am I creating a leak here through the "object" variable?
objc:
alloc init WavefrontObject3D object, , release , .
a delete object push_back, WavefrontObject3D object. , ptr_vector object. ?
, : , ApplicationEngine, - ptr_vector ,