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

@ -195,6 +195,8 @@ void Force::create_pair(const char *style, int trysuffix)
{
delete [] pair_style;
if (pair) delete pair;
pair_style = NULL;
pair = NULL;
int sflag;
pair = new_pair(style,trysuffix,sflag);