(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
This commit is contained in:
Andrew McCallum 1996-09-17 21:07:17 +00:00
parent 797e1bdec9
commit d9bce0510c

View file

@ -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
{