mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
(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:
parent
797e1bdec9
commit
d9bce0510c
1 changed files with 7 additions and 9 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue