File tree Expand file tree Collapse file tree 3 files changed +20
-10
lines changed Expand file tree Collapse file tree 3 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ PHP NEWS
17
17
. Fixed bug #79248 (Traversing empty VT_ARRAY throws com_exception). (cmb)
18
18
. Fixed bug #79299 (com_print_typeinfo prints duplicate variables). (Litiano
19
19
Moura)
20
+ . Fixed bug #79332 (php_istreams are never freed). (cmb)
20
21
21
22
- CURL:
22
23
. Fixed bug #79019 (Copied cURL handles upload empty file). (cmb)
Original file line number Diff line number Diff line change @@ -248,13 +248,6 @@ static struct IStreamVtbl php_istream_vtbl = {
248
248
249
249
static void istream_destructor (php_istream * stm )
250
250
{
251
- if (stm -> res ) {
252
- zend_resource * res = stm -> res ;
253
- stm -> res = NULL ;
254
- zend_list_delete (res );
255
- return ;
256
- }
257
-
258
251
if (stm -> refcount > 0 ) {
259
252
CoDisconnectObject ((IUnknown * )stm , 0 );
260
253
}
@@ -268,7 +261,6 @@ static void istream_destructor(php_istream *stm)
268
261
PHP_COM_DOTNET_API IStream * php_com_wrapper_export_stream (php_stream * stream )
269
262
{
270
263
php_istream * stm = (php_istream * )CoTaskMemAlloc (sizeof (* stm ));
271
- zval * tmp ;
272
264
273
265
if (stm == NULL )
274
266
return NULL ;
@@ -280,8 +272,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream)
280
272
stm -> stream = stream ;
281
273
282
274
GC_ADDREF (stream -> res );
283
- tmp = zend_list_insert (stm , le_istream );
284
- stm -> res = Z_RES_P (tmp );
275
+ stm -> res = zend_register_resource (stm , le_istream );
285
276
286
277
return (IStream * )stm ;
287
278
}
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #79332 (php_istreams are never freed)
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ('com_dotnet ' )) die ('com_dotnet extension not available ' );
6
+ ?>
7
+ --FILE--
8
+ <?php
9
+ $ ph = new COMPersistHelper (null );
10
+ try {
11
+ $ ph ->LoadFromStream (fopen (__FILE__ , 'r ' ));
12
+ } catch (com_exception $ ex ) {
13
+ // use hard-coded message to avoid localization issues
14
+ echo "A com_exception has been thrown \n" ;
15
+ }
16
+ ?>
17
+ --EXPECT--
18
+ A com_exception has been thrown
You can’t perform that action at this time.
0 commit comments