Im using a STL vector in my SDL program. and it looks like this: vector< Bullet * > vec; this makes a vector that can contain pointers to Bullet objects. when i run my program i only add one item at a time using: vec.push_back( new_bullet ); (new_bullet is a pointer to a “new” Bullet object. then in a following function i erase an object using: vec.erase(…); vec.size() shows that the items are being pushed and popped properly. I’m running Ubuntu 9.10 and System Monitor shows my programs memory usage slowly increasing. Is it my program or something I’m missing about STL vector?
Share
Sounds like you’re not
deleteing the “bullet” objects as you remove them from the vector.