From 1aa4f8a45c3afd60b59085f6eb8d96f26198f0e1 Mon Sep 17 00:00:00 2001
From: Robert Izzard <r.izzard@surrey.ac.uk>
Date: Wed, 11 Aug 2021 19:40:27 +0100
Subject: [PATCH] update CHANGES for V2.2.0

 fixed memory leak on disc append
---
 CHANGES                         | 23 +++++++++++++++++++++++
 src/disc/disc_initialize_disc.c |  6 ++++--
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/CHANGES b/CHANGES
index fadcfa30a..705e63459 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,26 @@
+V2.2.0
+
+Lots of updates for you in binary_c V2.2.0
+
+The circumbinary discs paper has been submitted, and all the discs code is in 2.2.0. Part of this was adding new post-AGB winds from Krticka, Kubát and Krticková (2020).
+
+There are many updates to the ensemble logging, including Gaia HRDs and logP-loge diagrams.
+
+MINT has improved vastly: the main-sequence works great, as does CHeB. This is not (yet) enabled by default. Please see tbse.mint and download stellar model data from http://personal.ph.surrey.ac.uk/~ri0005/MINT/
+
+Associated with this are changes to how tides are computed so we can properly use Zahn's theories.
+
+Binary_c-python is working well, please check out the repository at
+https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python
+
+Tom Comerford's triples work is in, but still considered experimental. If anyone has time to go through this to check it, there's a lot of great science waiting to happen.
+
+New "orbiting objects" code, so you can simulate (currently very simply) planets orbital around stars. Detects when they are swallowed, tidal interactions, wind accretion, etc. This is another part of binary_c that could easily be greatly improved with lots of fun science to be done. 
+
+Also synced the latest Perl modules and versions of librinterpolate, librchash and libmemoize.
+
+Lots of little bug fixes too, of course.
+
 V2.1.7
 
 Changes made after running through clang's static analyzer. None of the
diff --git a/src/disc/disc_initialize_disc.c b/src/disc/disc_initialize_disc.c
index 5b770c99d..9d8edaf2a 100644
--- a/src/disc/disc_initialize_disc.c
+++ b/src/disc/disc_initialize_disc.c
@@ -69,8 +69,10 @@ void disc_initialize_disc(struct stardata_t * const stardata,
     disc->prevzone = DISC_NO_PREVZONE_YET;
 #endif
 #ifdef MEMOIZE
-    disc->memo = NULL;
-    memoize_initialize(&disc->memo);
+    if(disc->memo==NULL)
+    {
+        memoize_initialize(&disc->memo);
+    }
 #endif
 
     /*
-- 
GitLab