Hello, i want to create a vector of pointers and delete them,but i am little confused whether my code is OKAY or not.
here's my code:
vector<Object*> SpriteList;
for(i=0;i<10;i++){
Object* tempobj;
tempobj=new Object();
SpriteList.push_back(tempobj)
}
for(int i=0;i < (int) SpriteList.size();i++){
delete SpriteList[i];
SpriteList.erase(SpriteList.begin()+i);
}
is there any memory Leak??plz help...