This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
release the global struct *after* we've finished using it
[perl5.git] / miniperlmain.c
index 7f63a34..61358f7 100644 (file)
@@ -138,12 +138,12 @@ main(int argc, char **argv, char **env)
     environ = env;
 #endif
 
+    PERL_SYS_TERM();
+
 #ifdef PERL_GLOBAL_STRUCT
     free_global_struct(plvarsp);
 #endif /* PERL_GLOBAL_STRUCT */
 
-    PERL_SYS_TERM();
-
     exit(exitstatus);
     return exitstatus;
 }