@@ -238,24 +238,6 @@ static void php_oci_init_global_handles(void)
238
238
}
239
239
/* }}} */
240
240
241
- /* {{{ php_oci_cleanup_global_handles()
242
- *
243
- * Free global handles (if they were initialized before)
244
- */
245
- static void php_oci_cleanup_global_handles (void )
246
- {
247
- if (OCI_G (err )) {
248
- PHP_OCI_CALL (OCIHandleFree , ((dvoid * ) OCI_G (err ), OCI_HTYPE_ERROR ));
249
- OCI_G (err ) = NULL ;
250
- }
251
-
252
- if (OCI_G (env )) {
253
- PHP_OCI_CALL (OCIHandleFree , ((dvoid * ) OCI_G (env ), OCI_HTYPE_ENV ));
254
- OCI_G (env ) = NULL ;
255
- }
256
- }
257
- /* }}} */
258
-
259
241
/* {{{ PHP_GINIT_FUNCTION
260
242
*
261
243
* Zerofill globals during module init
@@ -269,10 +251,23 @@ static PHP_GINIT_FUNCTION(oci)
269
251
/* {{{ PHP_GSHUTDOWN_FUNCTION
270
252
*
271
253
* Called for thread shutdown in ZTS, after module shutdown for non-ZTS
254
+ * Free global handles (if they were initialized before)
272
255
*/
273
256
static PHP_GSHUTDOWN_FUNCTION (oci )
274
257
{
275
- php_oci_cleanup_global_handles ();
258
+ if (oci_globals -> err ) {
259
+ oci_globals -> in_call = 1 ;
260
+ OCIHandleFree ((dvoid * ) oci_globals -> err , OCI_HTYPE_ERROR );
261
+ oci_globals -> in_call = 0 ;
262
+ oci_globals -> err = NULL ;
263
+ }
264
+
265
+ if (oci_globals -> env ) {
266
+ oci_globals -> in_call = 1 ;
267
+ OCIHandleFree ((dvoid * ) oci_globals -> env , OCI_HTYPE_ENV );
268
+ oci_globals -> in_call = 0 ;
269
+ oci_globals -> env = NULL ;
270
+ }
276
271
}
277
272
/* }}} */
278
273
0 commit comments