diff --git a/src/main.c b/src/main.c
index 0d377a4ec2fc0f5f7f99686fddbbc8d82f140d5a..b41d531015df27a2247049af7b48a0cbd009eaf1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4,7 +4,7 @@
 ||| See the files COPYING and DISCLAIMER for more information.
 \*/
 #include "global.h"
-RCSID("$Id: main.c,v 1.13 1996/12/05 01:51:21 hubbe Exp $");
+RCSID("$Id: main.c,v 1.14 1997/01/14 18:16:23 nisse Exp $");
 #include "types.h"
 #include "backend.h"
 #include "module.h"
@@ -273,8 +273,8 @@ void exit_main()
   void cleanup_program();
 
   th_cleanup();
-  exit_dynamic_load();
   cleanup_objects();
+  exit_dynamic_load();
   exit_signals();
   exit_lex();
   cleanup_interpret();