Hi,
i know this is not clever to do and there can be problems if an exception it thrown, but my app is running out of memory and this is because i load some data into my object process it and don't use it any more. now, with processed results i need to do some stuff further but for that i need memory. and i would have tons of it if i deleted my object. so how can i delete an object:
Code:
int main(){
Data<unsigned long, unsigned long> myobject(file_in);
vector<unsigned long> results(myobject.GetData().size());
for(unsigned long i = 0;i<myobject.GetData().size();i++){
// do stuff
}
//don't need myobject any more i have my results
delete myobject; // does not work
}
is there any way around this ?? I need memory. Should i maybe do this in another function and then send back a copy of my results. then my object should be deleted automatically since it is out of scope, right??
thnx