[svn:mod_parrot] r327 - mod_parrot/tags/REL_0_4/src

[email protected] Sun, 20 Jan 2008 10:13:35 -0800 (PST)
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Sun Jan 20 10:13:35 2008
New Revision: 327

Modified:
   mod_parrot/tags/REL_0_4/src/mod_parrot.c

Log:
merge pre-release fix from trunk


Modified: mod_parrot/tags/REL_0_4/src/mod_parrot.c
==============================================================================
--- mod_parrot/tags/REL_0_4/src/mod_parrot.c	(original)
+++ mod_parrot/tags/REL_0_4/src/mod_parrot.c	Sun Jan 20 10:13:35 2008
@@ -136,7 +136,8 @@
     Parrot_PMC ctx_class;
     Parrot_PMC ctx_pmc;
     Parrot_PMC namespace;
-    int typenum;
+    Parrot_Int typenum;
+    int res;
 
     typenum = Parrot_PMC_typenum(interp, "ResizableStringArray");
     namespace = (Parrot_PMC)Parrot_PMC_new(interp, typenum);
@@ -144,19 +145,18 @@
     Parrot_PMC_set_intval(interp, namespace, 2);
     Parrot_PMC_set_cstring_intkey(interp, namespace, 0, "ModParrot");
     Parrot_PMC_set_cstring_intkey(interp, namespace, 1, "Context");
-
     ctx_class = Parrot_oo_get_class(interp, namespace);
-    ctx_pmc = VTABLE_instantiate(interp, ctx_class, PMCNULL);
-
     Parrot_unregister_pmc(interp, namespace);
 
-    if (!hll) hll = MODPARROT_DEFAULT_HLL;
-    if (!modparrot_call_sub_IPS(interp, hll, hll_handler, ret, ctx_pmc,
-        handler)) {
-        return(0);
-    }
+    ctx_pmc = (Parrot_PMC)Parrot_Class_instantiate(interp, ctx_class, PMCNULL);
+    Parrot_register_pmc(interp, ctx_pmc);
+
 
-    return(1);
+    if (!hll) hll = MODPARROT_DEFAULT_HLL;
+    res = modparrot_call_sub_IPS(interp, hll, hll_handler, ret, ctx_pmc,
+        handler);
+    Parrot_unregister_pmc(interp, ctx_pmc);
+    return res ? 1 : 0;
 }
 
 static char *get_request_hll(request_rec *r, const char *handler,