]> granicus.if.org Git - php/commitdiff
MFH: Fix warning when inner stream of a temp:// stream is closed before
authorArnaud Le Blanc <lbarnaud@php.net>
Sat, 16 May 2009 20:28:02 +0000 (20:28 +0000)
committerArnaud Le Blanc <lbarnaud@php.net>
Sat, 16 May 2009 20:28:02 +0000 (20:28 +0000)
the stream ifself

main/streams/memory.c

index fd99782ccf2817df933564b0f8d796410a9451e5..a44fba4c24275a6351f0c5b05c3a07c3c1ebf9c5 100644 (file)
@@ -563,6 +563,7 @@ PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STR
        stream = php_stream_alloc_rel(&php_stream_temp_ops, self, 0, mode & TEMP_STREAM_READONLY ? "rb" : "w+b");
        stream->flags |= PHP_STREAM_FLAG_NO_BUFFER;
        self->innerstream = php_stream_memory_create_rel(mode);
+       php_stream_auto_cleanup(self->innerstream); // do not warn if innerstream is GC'ed before stream
        ((php_stream_memory_data*)self->innerstream->abstract)->owner_ptr = &self->innerstream;
 
        return stream;