diff options
Diffstat (limited to 'ext/oracle/oracle.c')
| -rw-r--r-- | ext/oracle/oracle.c | 17 | 
1 files changed, 12 insertions, 5 deletions
diff --git a/ext/oracle/oracle.c b/ext/oracle/oracle.c index b354b26a80..a0f03b1a73 100644 --- a/ext/oracle/oracle.c +++ b/ext/oracle/oracle.c @@ -65,7 +65,7 @@ PHP_ORA_API php_ora_globals ora_globals;  static oraCursor *ora_get_cursor(HashTable *, pval **);  static char *ora_error(Cda_Def *);  static int ora_describe_define(oraCursor *); -static int _close_oraconn(oraConnection *conn); +static int _close_oraconn(zend_rsrc_list_entry *rsrc);  static int _close_oracur(oraCursor *cur);  static int _ora_ping(oraConnection *conn);  int ora_set_param_values(oraCursor *cursor, int isout); @@ -181,8 +181,9 @@ static const text *ora_func_tab[] =  ZEND_GET_MODULE(oracle)  #endif -static int _close_oraconn(oraConnection *conn) +static int _close_oraconn(zend_rsrc_list_entry *rsrc)  { +	oraConnection *conn = (oraConnection *)rsrc->ptr;  	ORALS_FETCH();  	conn->open = 0; @@ -248,6 +249,12 @@ static int _close_oracur(oraCursor *cur)  	return 1;  } +static void php_close_ora_cursor(zend_rsrc_list_entry *rsrc) +{ +	oraCursor *cur = (oraCursor *)rsrc->ptr; +	_close_oracur(cur); +} +  static void php_ora_init_globals(ORALS_D)  {  	if (cfg_get_long("oracle.allow_persistent", @@ -283,9 +290,9 @@ PHP_MINIT_FUNCTION(oracle)  	php_ora_init_globals(ORALS_C);  #endif -	le_cursor = register_list_destructors(_close_oracur, NULL); -	le_conn = register_list_destructors(_close_oraconn, NULL); -	le_pconn = register_list_destructors(NULL, _close_oraconn); +	le_cursor = register_list_destructors(php_close_ora_cursor, NULL, "oracle cursor"); +	le_conn = register_list_destructors(_close_oraconn, NULL, "oracle link"); +	le_pconn = register_list_destructors(NULL, _close_oraconn, "oracle link persistent");  	REGISTER_LONG_CONSTANT("ORA_BIND_INOUT", 0, CONST_CS | CONST_PERSISTENT);  	REGISTER_LONG_CONSTANT("ORA_BIND_IN",    1, CONST_CS | CONST_PERSISTENT);  | 
