]> granicus.if.org Git - php/commitdiff
MFH
authorAntony Dovgal <tony2001@php.net>
Fri, 11 Jul 2008 12:44:02 +0000 (12:44 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 11 Jul 2008 12:44:02 +0000 (12:44 +0000)
ext/reflection/tests/reflectionExtension_getDependencies_basic.phpt
main/streams/streams.c

index fff5c746f8ccaa09753c1ea74731bc9632a7b607..8b5293a48f5033ce5a9d12790be48f8ce399271a 100644 (file)
@@ -2,6 +2,10 @@
 ReflectionExtension::getDependencies() method on an extension with a required and conflicting dependency
 --CREDITS--
 Felix De Vliegher <felix.devliegher@gmail.com>
+--SKIPIF--
+<?php
+if (!extension_loaded("dom")) die("skip no dom extension");
+?>
 --FILE--
 <?php
 $dom = new ReflectionExtension('dom');
index 14bbcd265781e0390af301109c22eeccb82d99bb..118c537648afa810125a651a5ded3a405f56707d 100755 (executable)
@@ -1806,8 +1806,9 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio
                                opened_path, context STREAMS_REL_CC TSRMLS_CC);
                }
 
-               if (context) {
-                       zend_list_addref(context->rsrc_id);
+               /* increase context refcount only if the context is really used */
+               if (stream && stream->context) {
+                       zend_list_addref(stream->context->rsrc_id);
                }
 
                /* if the caller asked for a persistent stream but the wrapper did not