Re: cvs: php-src /ext/ncurses ncurses_functions.c
| From: | Andi Gutmans | Date: | Mon, 18 Apr 2005 19:32:10 +0000 |
| Subject: | Re: cvs: php-src /ext/ncurses ncurses_functions.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-31461@lists.php.net to get a copy of this message | ||
I think you are wrong. It should give a nice warning message.
It's pointless in doing this, because you could have other copies of the resource in other PHP variables. Please nuke that...
Thanks,
Andi
At 11:38 PM 4/16/2005 +0200, Andrey Hristov wrote:
Hi Andi, last time I checked with 5.1 I was getting sth like resource(%d) of Unknown type .... Which leads me to think that the user may pass the resource to a function and it will greacefully go through zend_parse_parameters() and will fail probably during FETCH_RESOURCE with getting a FALSE back but without any warning. But it is possible that I am wrong. Andrey Andi Gutmans wrote:Andrey, You should remove ZVAL_NULL(). We don't NULL resource zval if they are deleted. PHP handles that gracefully if mistakenly accessed... Andi At 10:23 PM 4/10/2005 +0000, Andrey Hristov wrote:andrey Sun Apr 10 17:23:28 2005 EDTModified files:/php-src/ext/ncurses ncurses_functions.cLog: fix proto. return true instead of null http://cvs.php.net/diff.php/php-src/ext/ncurses/ncurses_functions.c?r1=1.46&r2=1.47&ty=u Index: php-src/ext/ncurses/ncurses_functions.c diff -u php-src/ext/ncurses/ncurses_functions.c:1.46 php-src/ext/ncurses/ncurses_functions.c:1.47--- php-src/ext/ncurses/ncurses_functions.c:1.46 Wed Jan 19 21:02:09 2005 +++ php-src/ext/ncurses/ncurses_functions.c Sun Apr 10 17:23:27 2005@@ -84,7 +84,7 @@ /* }}} */ #endif -/* {{{ proto int ncurses_delwin(resource window) +/* {{{ proto bool ncurses_delwin(resource window)Deletes a ncurses window */PHP_FUNCTION(ncurses_delwin) { @@ -98,6 +98,8 @@FETCH_WINRES(w, &handle);zend_list_delete(Z_LVAL_P(handle)); + ZVAL_NULL(handle); + RETURN_TRUE;} /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php