[926] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r913 - branches/barnowl_sqlite/owl

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:11:12 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
X-Original-To: nelhage@nelhage.com
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Fri,  1 Feb 2008 02:17:43 -0500 (EST)

Author: nelhage
Date: 2008-02-01 02:17:40 -0500 (Fri, 01 Feb 2008)
New Revision: 913

Modified:
   branches/barnowl_sqlite/owl/functions.c
   branches/barnowl_sqlite/owl/perlconfig.c
Log:
Destroy the perl interpreter when we quit


Modified: branches/barnowl_sqlite/owl/functions.c
===================================================================
--- branches/barnowl_sqlite/owl/functions.c	2008-02-01 06:50:06 UTC (rev 912)
+++ branches/barnowl_sqlite/owl/functions.c	2008-02-01 07:17:40 UTC (rev 913)
@@ -991,6 +991,8 @@
     owl_aim_logout();
   }
 
+  owl_perlconfig_shutdown();
+
   /* done with curses */
   endwin();
 

Modified: branches/barnowl_sqlite/owl/perlconfig.c
===================================================================
--- branches/barnowl_sqlite/owl/perlconfig.c	2008-02-01 06:50:06 UTC (rev 912)
+++ branches/barnowl_sqlite/owl/perlconfig.c	2008-02-01 07:17:40 UTC (rev 913)
@@ -159,7 +159,7 @@
   int ret;
   PerlInterpreter *p;
   char *err;
-  char *args[4] = {"", "-e", "0;", NULL};
+  char *args[] = {"", "-e", "0;", NULL};
 
   /* create and initialize interpreter */
   p=perl_alloc();
@@ -169,7 +169,7 @@
   owl_global_set_no_have_config(&g);
 
 
-  ret=perl_parse(p, owl_perl_xs_init, 2, args, NULL);
+  ret=perl_parse(p, owl_perl_xs_init, sizeof(args)/sizeof(*args) - 1, args, NULL);
   if (ret || SvTRUE(ERRSV)) {
     STRLEN n_a;
     err=owl_strdup(SvPV(ERRSV, n_a));
@@ -223,6 +223,13 @@
   return(NULL);
 }
 
+void owl_perlconfig_shutdown() {
+  PerlInterpreter *p;
+  p = owl_global_get_perlinterp(&g);
+  perl_destruct(p);
+  perl_free(p);
+}
+
 /* returns whether or not a function exists */
 int owl_perlconfig_is_function(char *fn) {
   if (perl_get_cv(fn, FALSE)) return(1);


home help back first fref pref prev next nref lref last post