Clean up leaks
authorKevin Boyd <kevin44boyd@gmail.com>
Sat, 10 Apr 2021 20:25:12 +0000 (20:25 +0000)
committerAndrey Alekseenko <al42and@gmail.com>
Sat, 10 Apr 2021 20:25:12 +0000 (20:25 +0000)
admin/lsan-suppressions.txt
src/external/thread_mpi/src/tmpi_init.cpp

index 6ae0443a06cfaf9764e354865339f23834c0c607..0c397fd941c1156752d694733a6f8e69decd039a 100644 (file)
@@ -17,8 +17,6 @@ leak:get_zone_pulse_cgs
 leak:gmx::DomainDecompositionBuilder::Impl::build
 leak:gmx_check
 leak:gmx_make_edi
-leak:gmx_mtop_ilistloop_init
-leak:gmx_pme_init
 leak:gmx_pme_receive_f
 leak:init_dfhist_state
 leak:init_df_history
@@ -39,7 +37,6 @@ leak:mdoutf_write_to_trajectory_files
 # Stack trace does not report a function beyond gmx_srenew_impl, so the file is suppressed instead.
 leak:pairlist.cpp
 leak:read_rotparams
-leak:set_ddgrid_parameters
 leak:set_reference_positions
 leak:set_state_entries
 leak:visitOption
index e2576ef0bb3dca9ad4aad370e7bf5aac22eab8ef..812d5131e30677b454594f7e6728bc62fa1bbcd0 100644 (file)
@@ -2,7 +2,7 @@
    This source code file is part of thread_mpi.
    Written by Sander Pronk, Erik Lindahl, and possibly others.
 
-   Copyright (c) 2009,2018, Sander Pronk, Erik Lindahl.
+   Copyright (c) 2009,2018,2021, Sander Pronk, Erik Lindahl.
    All rights reserved.
 
    Redistribution and use in source and binary forms, with or without
@@ -369,6 +369,12 @@ static void tMPI_Global_destroy(struct tmpi_global *g)
     tMPI_Thread_barrier_destroy(&(g->barrier));
     tMPI_Thread_mutex_destroy(&(g->timer_mutex));
     tMPI_Thread_mutex_destroy(&(g->comm_link_lock));
+    for (int i = 0; i < g->N_usertypes; i++)
+    {
+        tMPI_Free(g->usertypes[i]->comps);
+        tMPI_Free(g->usertypes[i]);
+    }
+    tMPI_Free(g->usertypes);
 }