release the global struct *after* we've finished using it
authorTony Cook <tony@develop-help.com>
Tue, 22 Jan 2013 11:37:34 +0000 (22:37 +1100)
committerTony Cook <tony@develop-help.com>
Fri, 25 Jan 2013 02:54:12 +0000 (13:54 +1100)
lib/ExtUtils/t/Embed.t
miniperlmain.c

index 269b20a..7a83c98 100644 (file)
@@ -204,13 +204,13 @@ int main(int argc, char **argv, char **env) {
 
     perl_free(my_perl);
 
-#ifdef PERL_GLOBAL_STRUCT
-    free_global_struct(plvarsp);
-#endif /* PERL_GLOBAL_STRUCT */
-
     my_puts("ok 8");
 
     PERL_SYS_TERM();
 
+#ifdef PERL_GLOBAL_STRUCT
+    free_global_struct(plvarsp);
+#endif /* PERL_GLOBAL_STRUCT */
+
     return 0;
 }
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;
 }