Fix a memory leak in generate_isa_predicate_for()
[gitmo/Mouse.git] / xs-src / MouseUtil.xs
index 93160fc..006eab2 100644 (file)
@@ -202,8 +202,7 @@ mouse_call1 (pTHX_ SV* const self, SV* const method, SV* const arg1) {
 
 int
 mouse_predicate_call(pTHX_ SV* const self, SV* const method) {
-    SV* const value = mcall0(self, method);
-    return SvTRUE(value);
+    return sv_true( mcall0(self, method) );
 }
 
 SV*
@@ -378,6 +377,6 @@ PPCODE:
     }
 
     if(predicate_name == NULL){ /* anonymous predicate */
-        XPUSHs( newRV_noinc((SV*)xsub) );
+        mXPUSHs( newRV_inc((SV*)xsub) );
     }
 }