From a449ff3ef3824ff9db7a6a70fe48f6893558ce23 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Fri, 14 Mar 1997 02:24:54 +0000
Subject: [PATCH] [project @ 1997-03-14 02:24:54 by sof] Free foreign objects
 on exit

---
 ghc/runtime/storage/SMinit.lc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ghc/runtime/storage/SMinit.lc b/ghc/runtime/storage/SMinit.lc
index 4224c9a2b948..6de8ecba5b62 100644
--- a/ghc/runtime/storage/SMinit.lc
+++ b/ghc/runtime/storage/SMinit.lc
@@ -23,6 +23,8 @@ A filehandle to which any storage-manager statistics should be written.
 rtsBool
 exitSM (smInfo *sm_info)
 {
+     /* Upon closing down the storage manager, we free all foreign objects */
+    freeForeigns(sm_info->ForeignObjList);
     stat_exit(sm_info->hp - hp_start);
 
     return rtsTrue; /* I'm happy */
-- 
GitLab