M OC_Mapping.m +4 -0
@@ 226,6 226,10 @@ LOG("got svalue: %s\n", k->u.string->str
// add_ref(mapping);
v = low_mapping_lookup(mapping, k);
//LOG("looked it up.\n");
+free_svalue(k);
+if(k) free(k);
+LOG("refs: %d\n", k->u.dummy->refs);
+free_svalue(k);
if(!v)
{
// LOG("missed the entry.\n");
M dynamic_class.m +1 -0
@@ 405,6 405,7 @@ LOG("encoding mapping as OC_Mapping%s\n"
str = [[NSString alloc] initWithBytes: sv->u.string->str length: sv->u.string->len encoding: enc];
pop_stack();
argumentList[x] = &(str);
+ [str autorelease];
}
else
Pike_error("Type mismatch for method argument.");
M util.m +0 -6
@@ 308,21 308,15 @@ struct svalue * low_id_to_svalue(id obj,
u8s = [obj UTF8String];
str = make_shared_binary_string(u8s, [obj lengthOfBytesUsingEncoding: enc]);
// free(u8s);
- // add_ref(str);
push_string(str);
f_utf8_to_string(1);
-// assign_svalue_no_free(sv, &(Pike_sp[-1]));
TYPEOF(*sv) = T_STRING;
SUBTYPEOF(*sv) = 0;
sv->u.string = Pike_sp[-1].u.string;
// sv->u.string = str;;
add_ref(sv->u.string);
-LOG("str: %s\n", sv->u.string->str);
pop_stack();
LOG("str: %s\n", sv->u.string->str);
-LOG("str: %p\n", sv);
-LOG("str: %p\n", sv->u);
-LOG("str: %d\n", sizeof(sv));
return sv;
}
}