Reset stash iterators
gfx [Sat, 27 Feb 2010 02:55:55 +0000 (11:55 +0900)]
xs-src/MouseUtil.xs

index fad81d0..3c02d18 100644 (file)
@@ -176,11 +176,13 @@ mouse_is_class_loaded(pTHX_ SV * const klass){
         GV* const gv = (GV*)HeVAL(he);
 
         if(isGV(gv)){
-            if(GvCVu(gv)){
+            if(GvCVu(gv)){ /* is GV and has CV */
+                hv_iterinit(stash); /* reset */
                 return TRUE;
             }
         }
-        else if(SvOK(gv)){
+        else if(SvOK(gv)){ /* is a stub or constant */
+            hv_iterinit(stash); /* reset */
             return TRUE;
         }
     }