exitstatus = perl_parse(my_perl, xs_init, argc, argv, (char **)NULL);
if (!exitstatus) {
exitstatus = perl_run(my_perl);
+ perl_destruct(my_perl);
+ exitstatus = STATUS_NATIVE_EXPORT;
+ } else {
+ perl_destruct(my_perl);
}
- perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();
#endif
LEAVE;
+ {
+ dJMPENV;
+ int x = 0;
+ JMPENV_PUSH(x);
+ if (PL_endav && !PL_minus_c)
+ call_list(PL_scopestack_ix, PL_endav);
+ JMPENV_POP;
+ }
FREETMPS;
-
/* We must account for everything. */
/* Destroy the main CV and syntax tree */
LEAVE;
FREETMPS;
PL_curstash = PL_defstash;
- if (PL_endav && !PL_minus_c)
- call_list(oldscope, PL_endav);
#ifdef MYMALLOC
if (PerlEnv_getenv("PERL_DEBUG_MSTATS"))
dump_mstats("after execution: ");