int snapshot_menu(const basic_snap_data& snap, const int& num_of_snaps) { int x = 0; char ch; chrono_date t; //time class... fsys_class p = snap.path; //my filesystem class t.asc_time = snap.date; //setting time class to the date of the snapshot (unimportant) ULL path_count = 0; //here is where the problems are: snapshot_class snapshot = snap.path; //no problems here path_count = snapshot.gsnap().size(); //here is when memory skyrockets snapshot.clear(); //after this, there is remaining memory allocated... while(x == 0) { cls(); cout<< endl; cout<< " Snapshot Menu: "<< t.std_time_disp()<< endl; cout<< "(Number of paths obtained: "<< path_count<< ")"<< endl; cout<< endl<< endl<< endl; cout<< " 1 - Find Changes"; if(num_of_snaps < 2) { cout<< " (Not enough snapshots...)"; } cout<< endl; cout<< " 2 - Delete Snapshot"<< endl; cout<< " q - Done"<< endl; ch = gkey(); if(ch == '1') { compare_snapshot(snap); continue; } if(ch == '2') { if(is_sure("Do you really want to delete this snapshot?") == true) { p.del(); return 1; } continue; } ch = tolower(ch); if(ch == 'q') { return 0; } } return 0; }