Skip to content

Commit

Permalink
added frees to get_ python functions
Browse files Browse the repository at this point in the history
  • Loading branch information
itrharrison committed Aug 3, 2022
1 parent 468d794 commit 707e070
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions hi_class_public/python/classy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,9 @@ cdef class Class:
for index in range(timesteps):
background[names[i]][index] = data[index*number_of_titles+i]

free(titles)
free(data)

return background

def get_thermodynamics(self):
Expand Down Expand Up @@ -1058,6 +1061,9 @@ cdef class Class:
for index in range(timesteps):
thermodynamics[names[i]][index] = data[index*number_of_titles+i]

free(titles)
free(data)

return thermodynamics

def get_primordial(self):
Expand Down Expand Up @@ -1094,6 +1100,9 @@ cdef class Class:
for index in range(timesteps):
primordial[names[i]][index] = data[index*number_of_titles+i]

free(titles)
free(data)

return primordial


Expand Down Expand Up @@ -1244,6 +1253,9 @@ cdef class Class:
else:
spectra[ic_key] = tmpdict

free(titles)
free(data)

return spectra


Expand Down

0 comments on commit 707e070

Please sign in to comment.