git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12005 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2014-05-20 16:27:35 +00:00
parent 4b8aa5d4e7
commit 6da7b2f37c
1 changed files with 3 additions and 3 deletions

View File

@ -255,7 +255,7 @@ void *lammps_extract_compute(void *ptr, char *id, int style, int type)
so the caller must free this memory to avoid a leak, e.g. so the caller must free this memory to avoid a leak, e.g.
double *dptr = (double *) lammps_extract_fix(); double *dptr = (double *) lammps_extract_fix();
double value = *dptr; double value = *dptr;
free(dptr); lammps_free(dptr);
IMPORTANT: LAMMPS cannot easily check here when info extracted from IMPORTANT: LAMMPS cannot easily check here when info extracted from
the fix is valid, so caller must insure that it is OK the fix is valid, so caller must insure that it is OK
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
@ -320,11 +320,11 @@ void *lammps_extract_fix(void *ptr, char *id, int style, int type,
e.g. for equal-style variables e.g. for equal-style variables
double *dptr = (double *) lammps_extract_variable(); double *dptr = (double *) lammps_extract_variable();
double value = *dptr; double value = *dptr;
free(dptr); lammps_free(dptr);
e.g. for atom-style variables e.g. for atom-style variables
double *vector = (double *) lammps_extract_variable(); double *vector = (double *) lammps_extract_variable();
use the vector values use the vector values
free(vector); lammps_free(vector);
IMPORTANT: LAMMPS cannot easily check here when it is valid to evaluate IMPORTANT: LAMMPS cannot easily check here when it is valid to evaluate
the variable or any fixes or computes or thermodynamic info it references, the variable or any fixes or computes or thermodynamic info it references,
so caller must insure that it is OK so caller must insure that it is OK