p |bool |do_aexec5 |SV* really|SV** mark|SV** sp|int fd|int flag
Ap |int |do_binmode |PerlIO *fp|int iotype|int flag
p |void |do_chop |SV* asv|SV* sv
-p |bool |do_close |GV* gv|bool not_implicit
+Ap |bool |do_close |GV* gv|bool not_implicit
p |bool |do_eof |GV* gv
p |bool |do_exec |char* cmd
#if !defined(WIN32)
Perl_die
Perl_dounwind
Perl_do_binmode
+Perl_do_close
Perl_do_open
Perl_do_open9
Perl_dowantarray
#define Perl_do_binmode pPerl->Perl_do_binmode
#undef do_binmode
#define do_binmode Perl_do_binmode
+#undef Perl_do_close
+#define Perl_do_close pPerl->Perl_do_close
+#undef do_close
+#define do_close Perl_do_close
#if !defined(WIN32)
#endif
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
#if defined(PERL_OBJECT)
PerlMem_free(this);
#else
+# if defined(PERL_IMPLICIT_SYS) && defined(WIN32)
+ void *host = w32_internal_host;
PerlMem_free(aTHXx);
+ win32_delete_internal_host(host);
+# else
+ PerlMem_free(aTHXx);
+# endif
#endif
}
{
return ((CPerlObj*)pPerl)->Perl_do_binmode(fp, iotype, flag);
}
+
+#undef Perl_do_close
+bool
+Perl_do_close(pTHXo_ GV* gv, bool not_implicit)
+{
+ return ((CPerlObj*)pPerl)->Perl_do_close(gv, not_implicit);
+}
#if !defined(WIN32)
#endif
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
PL_main_root = Nullop;
}
+ /* close the std handles to avoid fd leaks */
+ {
+ do_close(gv_fetchpv("STDIN", TRUE, SVt_PVIO), FALSE);
+ do_close(gv_fetchpv("STDOUT", TRUE, SVt_PVIO), FALSE);
+ do_close(gv_fetchpv("STDERR", TRUE, SVt_PVIO), FALSE);
+ }
+
/* destroy everything (waits for any pseudo-forked children) */
perl_destruct(my_perl);
perl_free(my_perl);
return my_perl;
}
+EXTERN_C void
+win32_delete_internal_host(void *h)
+{
+ CPerlHost *host = (CPerlHost*)h;
+ delete host;
+}
+
#ifdef PERL_OBJECT
EXTERN_C void
{
win32_fprintf(stderr, "%s\n",
"Error: Unable to construct data structures");
- CPerlHost* pHost = (CPerlHost*)w32_internal_host;
- Perl_free();
- delete pHost;
- PERL_SET_THX(NULL);
+ perl_free(my_perl);
}
}
perl_free(PerlInterpreter* my_perl)
{
CPerlObj* pPerl = (CPerlObj*)my_perl;
+ void *host = w32_internal_host;
#ifdef DEBUGGING
- CPerlHost* pHost = (CPerlHost*)w32_internal_host;
Perl_free();
- delete pHost;
#else
try
{
- CPerlHost* pHost = (CPerlHost*)w32_internal_host;
Perl_free();
- delete pHost;
}
catch(...)
{
}
#endif
+ win32_delete_internal_host(host);
PERL_SET_THX(NULL);
}
perl_run(PerlInterpreter* my_perl)
{
CPerlObj* pPerl = (CPerlObj*)my_perl;
+ int retVal;
#ifdef DEBUGGING
- return Perl_run();
+ retVal = Perl_run();
#else
- int retVal;
try
{
retVal = Perl_run();
win32_fprintf(stderr, "Error: Runtime exception\n");
retVal = -1;
}
- return retVal;
#endif
+ return retVal;
}
EXTERN_C int
extern int IsWinNT(void);
extern void win32_argv2utf8(int argc, char** argv);
+#ifdef PERL_IMPLICIT_SYS
+extern void win32_delete_internal_host(void *h);
+#endif
+
extern char * staticlinkmodules[];
END_EXTERN_C