cvs: php4 /ext/standard basic_functions.c file.c

From: Date: Wed, 21 May 2003 21:36:51 +0000
Subject: cvs: php4 /ext/standard basic_functions.c file.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-21192@lists.php.net to get a copy of this message
pollita Wed May 21 17:36:51 2003 EDT Modified files: /php4/ext/standard basic_functions.c file.c Log: Setup FG(default_context) in RINIT/RSHUTDOWN instead of fg_ctor/fg_dtor. Frees context at right time without double freeing. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.610 php4/ext/standard/basic_functions.c:1.611 --- php4/ext/standard/basic_functions.c:1.610 Tue May 20 14:18:56 2003 +++ php4/ext/standard/basic_functions.c Wed May 21 17:36:50 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.610 2003/05/20 18:18:56 sterling Exp $ */ +/* $Id: basic_functions.c,v 1.611 2003/05/21 21:36:50 pollita Exp $ */ #include "php.h" #include "php_streams.h" @@ -1196,6 +1196,9 @@ /* Reset magic_quotes_runtime */ PG(magic_quotes_runtime) = INI_BOOL("magic_quotes_runtime"); + /* Setup default context */ + FG(default_context) = NULL; + return SUCCESS; } @@ -1243,6 +1246,11 @@ zend_hash_destroy(BG(user_filter_map)); efree(BG(user_filter_map)); BG(user_filter_map) = NULL; + } + + /* cleanup any default context that was created */ + if (FG(default_context)) { + php_stream_context_free(FG(default_context)); } return SUCCESS; Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.342 php4/ext/standard/file.c:1.343 --- php4/ext/standard/file.c:1.342 Wed May 21 09:33:55 2003 +++ php4/ext/standard/file.c Wed May 21 17:36:51 2003 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.342 2003/05/21 13:33:55 wez Exp $ */ +/* $Id: file.c,v 1.343 2003/05/21 21:36:51 pollita Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -137,15 +137,10 @@ FG(pclose_ret) = 0; FG(user_stream_current_filename) = NULL; FG(def_chunk_size) = PHP_SOCK_CHUNK_SIZE; - FG(default_context) = NULL; } static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC) { - if (FG(default_context)) { - /* This is being automagically freed elsewhere */ - FG(default_context) = NULL; - } }

« previous php.cvs (#21192) next »