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
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);
 
 
     perl_free(my_perl);
 
-#ifdef PERL_GLOBAL_STRUCT
-    free_global_struct(plvarsp);
-#endif /* PERL_GLOBAL_STRUCT */
-
     my_puts("ok 8");
 
     PERL_SYS_TERM();
 
     my_puts("ok 8");
 
     PERL_SYS_TERM();
 
+#ifdef PERL_GLOBAL_STRUCT
+    free_global_struct(plvarsp);
+#endif /* PERL_GLOBAL_STRUCT */
+
     return 0;
 }
     return 0;
 }
index 7f63a34..61358f7 100644 (file)
@@ -138,12 +138,12 @@ main(int argc, char **argv, char **env)
     environ = env;
 #endif
 
     environ = env;
 #endif
 
+    PERL_SYS_TERM();
+
 #ifdef PERL_GLOBAL_STRUCT
     free_global_struct(plvarsp);
 #endif /* PERL_GLOBAL_STRUCT */
 
 #ifdef PERL_GLOBAL_STRUCT
     free_global_struct(plvarsp);
 #endif /* PERL_GLOBAL_STRUCT */
 
-    PERL_SYS_TERM();
-
     exit(exitstatus);
     return exitstatus;
 }
     exit(exitstatus);
     return exitstatus;
 }