From 436267b7110ffa7ad72556d1b0e540063aa95bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20R=C3=B6=C3=B6sli?= Date: Thu, 3 Aug 2023 20:25:22 +0200 Subject: [PATCH] Free ecCodes buffer to avoid memory leak (#87) --- climada_petals/hazard/tc_tracks_forecast.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/climada_petals/hazard/tc_tracks_forecast.py b/climada_petals/hazard/tc_tracks_forecast.py index 04a1a0887..5b6b15684 100644 --- a/climada_petals/hazard/tc_tracks_forecast.py +++ b/climada_petals/hazard/tc_tracks_forecast.py @@ -418,6 +418,8 @@ def read_one_bufr_tc(self, file, id_no=None): self.append(track) else: LOGGER.debug('Dropping empty track %s, subset %d', name, i) + # release the BUFR message + ec.codes_release(bufr) def write_hdf5(self, file_name, complevel=5): """Write TC tracks in NetCDF4-compliant HDF5 format. This method