workaround for double free issue when using USER-COLVARS with lammps code loaded as shared library into a standalone executable

This commit is contained in:
Axel Kohlmeyer
2016-10-08 10:45:22 -04:00
parent e9fed80928
commit e01e90eb96
3 changed files with 8 additions and 8 deletions

View File

@ -1552,10 +1552,10 @@ std::string colvarmodule::restart_in_name = "";
// i/o constants
size_t const colvarmodule::it_width = 12;
size_t const colvarmodule::cv_prec = 14;
size_t const colvarmodule::cv_width = 21;
size_t const colvarmodule::en_prec = 14;
size_t const colvarmodule::en_width = 21;
std::string const colvarmodule::line_marker =
const size_t colvarmodule::it_width = 12;
const size_t colvarmodule::cv_prec = 14;
const size_t colvarmodule::cv_width = 21;
const size_t colvarmodule::en_prec = 14;
const size_t colvarmodule::en_width = 21;
const char * const colvarmodule::line_marker = (const char *)
"----------------------------------------------------------------------\n";

View File

@ -366,7 +366,7 @@ public:
/// Number of characters to represent the collective variables energy
static size_t const en_width;
/// Line separator in the log output
static std::string const line_marker;
static const char * const line_marker;
// proxy functions

View File

@ -193,7 +193,7 @@ double colvarproxy_lammps::compute()
previous_step = _lmp->update->ntimestep;
if (cvm::debug()) {
cvm::log(cvm::line_marker+
cvm::log(std::string(cvm::line_marker)+
"colvarproxy_lammps, step no. "+cvm::to_str(colvars->it)+"\n"+
"Updating internal data.\n");
}