correction of valgrin error
This commit is contained in:
@@ -47,7 +47,7 @@ std::ostream & operator<<(std::ostream & o, mystruct const * rhs) {
|
||||
// ************************************
|
||||
extern std::vector<A_test*> test_list;
|
||||
extern void add_to_list(std::string s, A_test* s1, A_test* s2, A_test* s3, A_test* s4);
|
||||
std::vector<mystruct*> mem_list_struct;
|
||||
std::vector<mystruct*> mem_list;
|
||||
|
||||
|
||||
// adding each test to the list
|
||||
@@ -101,7 +101,7 @@ template <>
|
||||
mystruct* val(int n) {
|
||||
|
||||
mystruct *s = new mystruct(n);
|
||||
mem_list_struct.push_back(s);
|
||||
mem_list.push_back(s);
|
||||
return ( s );
|
||||
}
|
||||
|
||||
@@ -126,10 +126,11 @@ template <class T>
|
||||
void delete_structs() {
|
||||
|
||||
std::vector<mystruct*>::iterator it;
|
||||
std::vector<mystruct*>::iterator it_end = mem_list_struct.end();
|
||||
std::vector<mystruct*>::iterator it_end = mem_list.end();
|
||||
|
||||
for (it = mem_list_struct.begin(); it != it_end; ++it)
|
||||
for (it = mem_list.begin(); it != it_end; ++it)
|
||||
delete *it;
|
||||
mem_list.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user