Quote Originally Posted by tonnot View Post
Every time I create class_a, a new instance is created, and there is no re-write of class_a->my_objectB, ins't it ?
No, as long my_objectB is not a static member of the class.
objectB instances inside the vector exist ?
If they were created on the heap (using operator new), they will exist until you call "delete" on them.
I have to free every objectB instance inside the vector with pop_back ? Or need I to do more ?
You need to call "delete" on the object to "free" it, pop_back will just remove the pointer from vector, it will not release the associated memory.

Any tip ?
I think you should do some redesign. For example, I have a feeling that at some point you want to delete each object from the vector. This is confusing, because if they all are a members of some ClassA, then it's more "natural" to think that the ClassA instance "owns" instance of ClassB, so it should be responsible for deleting them. If you explicitly delete instance from vector, then you will have a "dangling" pointer in ClassA objects.
Maybe you should use some kind of factory method for creating objects of ClassB instead of storing pointers to members. Or store pointers to ClassA in your vector and make this class responsible for ClassB objects.
Btw if the code snippet (the for loop) is unchanged in your actual code, then probably you have a memory leak - you do not "delete" the ClassA objects.