mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
fixed memory leak caused by duplicate numbered solutions (see ex12 -- solution 0) (previous fix was just a band-aid)
git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@6271 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
a35fb059dd
commit
fd26a7edb1
@ -51,6 +51,7 @@ cxxSolution::cxxSolution(PHRQ_io * io)
|
||||
this->initial_data = NULL;
|
||||
}
|
||||
cxxSolution::cxxSolution(const cxxSolution &old_sol)
|
||||
: initial_data(NULL)
|
||||
{
|
||||
*this = old_sol;
|
||||
}
|
||||
@ -80,6 +81,8 @@ cxxSolution::operator =(const cxxSolution &rhs)
|
||||
this->master_activity = rhs.master_activity;
|
||||
this->species_gamma = rhs.species_gamma;
|
||||
this->isotopes = rhs.isotopes;
|
||||
if (this->initial_data)
|
||||
delete initial_data;
|
||||
if (rhs.initial_data != NULL)
|
||||
this->initial_data = new cxxISolution(*rhs.initial_data);
|
||||
else
|
||||
|
||||
@ -4989,10 +4989,6 @@ read_solution(void)
|
||||
it->second.Set_pe_reaction(isoln_ptr->Get_default_pe());
|
||||
}
|
||||
}
|
||||
if (Rxn_solution_map.find(n_user) != Rxn_solution_map.end())
|
||||
{
|
||||
Rxn_solution_map.erase(Rxn_solution_map.find(n_user));
|
||||
}
|
||||
Rxn_solution_map[n_user] = temp_solution;
|
||||
|
||||
return (return_value);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user