NULLing pointers after delete

This commit is contained in:
Anders Hafreager
2017-01-04 16:04:05 +01:00
parent b10d0c17ec
commit 42bbeb3f16
2 changed files with 4 additions and 0 deletions

View File

@ -390,6 +390,8 @@ void Atom::create_avec(const char *style, int narg, char **arg, int trysuffix)
{
delete [] atom_style;
if (avec) delete avec;
atom_style = NULL;
avec = NULL;
// unset atom style and array existence flags
// may have been set by old avec