I have a classA, it creates objectsB * (by pointer)
Qt Code:
  1. my_objectB = new ObjectB; ( inside classA)
To copy to clipboard, switch view to plain text mode 

And from the main, I want to add "objectsB" to a vector.
Qt Code:
  1. vector<objectC*> my_vector; (my vector is private for main )
To copy to clipboard, switch view to plain text mode 

So, I can write inside main_create():
Qt Code:
  1. for (int x=0;x<10;xx++)
  2. {
  3. ClassA class_a* = new ClassA;
  4. my_vector.push_back(class_a->my_objectB)
  5. }
To copy to clipboard, switch view to plain text mode 

My doubt is ... 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 ?

Ok. on main I have main_process, a function that are going to do thing with the vector. My question is , objectB instances inside the vector exist ? or maybe I have a risk of crash becasue thet were created by a temporal classA inside 'main_create'.

By last. I have to free every objectB instance inside the vector with pop_back ? Or need I to do more ?
Any tip ? Thanks.