[NeoStats-Devel] [Commits] r2651 - trunk/src

[email protected]
Newsgroups gmane.comp.neostats.devel
Message-ID <[email protected]>
Author: Fish
Date: Thu Jul  7 22:09:12 2005
New Revision: 2651

Modified:
   trunk/src/perl.c
Log:
fix issue with multiple perl modules loaded, when we exit

Modified: trunk/src/perl.c
==============================================================================
--- trunk/src/perl.c	(original)
+++ trunk/src/perl.c	Thu Jul  7 22:09:12 2005
@@ -73,12 +73,12 @@
 	int count, ret_value = 1;
 	SV *sv;
 
+	PERL_SET_CONTEXT((PMI *)mod->pm->my_perl);
 	dSP;
 	ENTER;
 	SAVETMPS;
 
 	SET_RUN_LEVEL(mod);
-	PERL_SET_CONTEXT((PMI *)mod->pm->my_perl);
 
 	PUSHMARK (SP);
 	XPUSHs (sv_2mortal (newSVpv (args, 0)));
@@ -783,11 +783,12 @@
 	mod->modtype = MOD_PERL;
  	mod->info->name = NULL;
 	strlcpy(mod->pm->filename, filename, MAXPATH);
+	PL_perl_destruct_level = 2;
 	mod->pm->my_perl = perl_alloc ();
-	PL_perl_destruct_level = 1;
+	PL_perl_destruct_level = 2;
 	PERL_SET_CONTEXT((PMI *)mod->pm->my_perl);
 	perl_construct (mod->pm->my_perl);
-
+	PL_perl_destruct_level = 2;
 	perl_parse (mod->pm->my_perl, xs_init, 4, perl_args, NULL);
 	/*
 	   Now initialising the perl interpreter by loading the
@@ -842,6 +843,7 @@
 		PERL_SET_CONTEXT((PMI *)mod->pm->my_perl);
 		/* because segv handler doesn't handle perl well yet */
 		RESET_RUN_LEVEL()
+		PL_perl_destruct_level = 2;
 		perl_destruct ((PMI *)mod->pm->my_perl);
 
 		perl_free ((PMI *)mod->pm->my_perl);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.