Fix memory leak in Variable::compute_atom
This commit is contained in:
@ -971,6 +971,7 @@ void Variable::compute_atom(int ivar, int igroup,
|
|||||||
} else vstore = reader[ivar]->fixstore->vstore;
|
} else vstore = reader[ivar]->fixstore->vstore;
|
||||||
|
|
||||||
if (result == NULL) {
|
if (result == NULL) {
|
||||||
|
if (style[ivar] == ATOM) free_tree(tree);
|
||||||
eval_in_progress[ivar] = 0;
|
eval_in_progress[ivar] = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,6 +92,13 @@ class Variable : protected Pointers {
|
|||||||
int nextra; // # of additional args beyond first 2
|
int nextra; // # of additional args beyond first 2
|
||||||
Tree *first,*second; // ptrs further down tree for first 2 args
|
Tree *first,*second; // ptrs further down tree for first 2 args
|
||||||
Tree **extra; // ptrs further down tree for nextra args
|
Tree **extra; // ptrs further down tree for nextra args
|
||||||
|
|
||||||
|
Tree() :
|
||||||
|
array(NULL), iarray(NULL), barray(NULL),
|
||||||
|
selfalloc(0), nextra(0),
|
||||||
|
first(NULL), second(NULL), extra(NULL)
|
||||||
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int compute_python(int);
|
int compute_python(int);
|
||||||
|
|||||||
Reference in New Issue
Block a user