needed to new/delete species and phase structs

This commit is contained in:
David Parkhurst 2021-03-22 17:42:36 -06:00
parent ee6fa5331f
commit fd93f84687

View File

@ -67,7 +67,7 @@ clean_up(void)
for (j = 0; j < (int)s.size(); j++) for (j = 0; j < (int)s.size(); j++)
{ {
s_free(s[j]); s_free(s[j]);
s[j] = (struct species*)free_check_null(s[j]); delete s[j];
} }
s.clear(); s.clear();
@ -114,7 +114,7 @@ clean_up(void)
for (j = 0; j < (int)phases.size(); j++) for (j = 0; j < (int)phases.size(); j++)
{ {
phase_free(phases[j]); phase_free(phases[j]);
phases[j] = (struct phase*)free_check_null(phases[j]); delete phases[j];
} }
phases.clear(); phases.clear();
/* inverse */ /* inverse */
@ -1122,9 +1122,7 @@ phase_alloc(void)
/* /*
* Allocate space * Allocate space
*/ */
phase_ptr = (struct phase *) PHRQ_malloc(sizeof(struct phase)); phase_ptr = new struct phase;
if (phase_ptr == NULL)
malloc_error();
/* /*
* Initialize space * Initialize space
*/ */
@ -1780,9 +1778,7 @@ s_alloc(void)
*/ */
{ {
struct species *s_ptr; struct species *s_ptr;
s_ptr = (struct species *) PHRQ_malloc(sizeof(struct species)); s_ptr = new struct species;
if (s_ptr == NULL)
malloc_error();
/* /*
* set pointers in structure to NULL, variables to zero * set pointers in structure to NULL, variables to zero
*/ */