Index: src/OFBlock.m ================================================================== --- src/OFBlock.m +++ src/OFBlock.m @@ -266,13 +266,10 @@ if (src->forwarding == src) src->forwarding = *dst; memcpy(*dst, src, src->size); - /* src->forwarding points to us -> that's a reference */ - (*dst)->flags++; - if (src->size >= sizeof(of_block_byref_t)) src->byref_keep(*dst, src); } else *dst = src; @@ -439,11 +436,12 @@ return OF_RETAIN_COUNT_MAX; } - (void)release { - Block_release(self); + if (isa == (Class)&_NSConcreteMallocBlock) + Block_release(self); } - (void)dealloc { @throw [OFNotImplementedException newWithClass: isa Index: tests/OFBlockTests.m ================================================================== --- tests/OFBlockTests.m +++ tests/OFBlockTests.m @@ -66,11 +66,11 @@ [m isKindOfClass: [OFBlock class]]) TEST(@"Copying a global block", (id)g == [[g copy] autorelease]) TEST(@"Copying a malloc block", - (id)m == [[m copy] autorelease] && [m retainCount] == 2) + (id)m == [m copy] && [m retainCount] == 2) TEST(@"Autorelease a stack block", R([s autorelease])) TEST(@"Autorelease a global block", R([g autorelease]))