Index: src/OFMutableData.m ================================================================== --- src/OFMutableData.m +++ src/OFMutableData.m @@ -307,8 +307,17 @@ count: _count]; } - (void)makeImmutable { + if (_capacity != _count) { + @try { + _items = of_realloc(_items, _count, _itemSize); + _capacity = _count; + } @catch (OFOutOfMemoryException *e) { + /* We don't care, as we only made it smaller */ + } + } + object_setClass(self, [OFData class]); } @end