add_attribute tweaks
[gitmo/Class-MOP.git] / xs / Class.xs
index 0b8a968..e187b4d 100644 (file)
@@ -12,7 +12,7 @@ mop_update_method_map(pTHX_ SV *const self, SV *const class_name, HV *const stas
     dSP;
 
     symbols = mop_get_all_package_symbols(stash, TYPE_FILTER_CODE);
-
+    sv_2mortal((SV*)symbols);
     (void)hv_iterinit(symbols);
     while ( (coderef = hv_iternextsv(symbols, &method_name, &method_name_len)) ) {
         CV *cv = (CV *)SvRV(coderef);
@@ -93,15 +93,15 @@ get_method_map(self)
         SV *map_ref;
     PPCODE:
         if (!stash) {
-                       mXPUSHs(newRV_noinc((SV *)newHV()));
-                       return;
+             mXPUSHs(newRV_noinc((SV *)newHV()));
+             return;
         }
 
         current    = mop_check_package_cache_flag(aTHX_ stash);
         cache_flag = HeVAL( hv_fetch_ent(obj, KEY_FOR(package_cache_flag), TRUE, HASH_FOR(package_cache_flag)));
         map_ref    = HeVAL( hv_fetch_ent(obj, KEY_FOR(methods), TRUE, HASH_FOR(methods)));
 
-        /* in  $self->{methods} does not yet exist (or got deleted) */
+        /* $self->{methods} does not yet exist (or got deleted) */
         if ( !SvROK(map_ref) || SvTYPE(SvRV(map_ref)) != SVt_PVHV ) {
             SV *new_map_ref = newRV_noinc((SV *)newHV());
             sv_2mortal(new_map_ref);