title: C++ - Will deleting a vector of structs that contain vectors cause memory leaks?
body: <p>I am building a game and have a vector of objects called sprites.</p>
  
  <pre><code>struct Sprite
  {
      SpriteType texture;     // The texture enumeration
      float x;                // The x position of the sprite
      float y;                // The y position of the sprite
      float xVel;             // The x velocity of the sprite
      float yVel;             // The y velocity of the sprite
      int imgBlockX;          // The x block in the image
      int imgBlockY;          // The y block in the image
      int numFrames;          // The number of frames in the sprite animation
      int curFrame;           // The current frame of animation
      int delay;              // The delay between frame switches
      int elapsed;            // The amount of time on this frame
      long lastTime;          // The last update time
      long curTime;           // The current update time
      bool loop;              // Does this animation loop?
      int lifespan;           // The max lifespan of the sprite
      int order;              // 0 for first 1 for last
      bool hasChildren;       // Is this a parent sprite?
      int maxSize;
      std::vector&lt;SpriteChild&gt; children;// The sprites that are linked to this one (die when this one dies)
  };
  </code></pre>
  
  <p>As you can see at the bottom, it contains a vector itself of sprite children. If I delete an element from my sprite vector will it cause a memory leak with the spritechild vector or is that taken care of?</p>
  
  <p>Thanks!</p>