From d9bce0510c78aa822601e91075bd9a58d19b63a7 Mon Sep 17 00:00:00 2001 From: Andrew McCallum Date: Tue, 17 Sep 1996 21:07:17 +0000 Subject: [PATCH] (ostream_open_memory): Use new MemoryStream method to specify that buffer should not be deallocated when MemoryStream is deallocated. Don't do the extra retain that was the previous workaround. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1798 72102866-910b-0410-8b05-ffd578937521 --- Source/ostream.m | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/ostream.m b/Source/ostream.m index ba16917d4..1572d07a6 100644 --- a/Source/ostream.m +++ b/Source/ostream.m @@ -234,17 +234,15 @@ ostream_open_memory (const char *addr, int size, int mode) ostream* stream = _ostream_new_stream_struct(mode, &fmode); if (addr) { - stream->stream_obj = [[MemoryStream alloc] _initOnMallocBuffer: addr - size: size - eofPosition: size - prefix: 0 - position: 0]; + stream->stream_obj = [[MemoryStream alloc] + _initOnMallocBuffer: addr + freeWhenDone: NO + size: size + eofPosition: size + prefix: 0 + position: 0]; if (!stream->stream_obj) return NULL; - - /* xxxFIXME: Now way of telling MemoryStream that we own this buffer - so just ad an extra retain so we never free the stream */ - [(id)stream->stream_obj retain]; } else {