File tree 5 files changed +17
-38
lines changed
5 files changed +17
-38
lines changed Original file line number Diff line number Diff line change @@ -576,27 +576,6 @@ void ts_free_id(ts_rsrc_id id)
576
576
TSRM_ERROR ((TSRM_ERROR_LEVEL_CORE , "Successfully freed resource id %d" , id ));
577
577
}/*}}}*/
578
578
579
- TSRM_API void ts_apply_for_id (ts_rsrc_id id , void (* cb )(void * ))
580
- {
581
- int rsrc_id = TSRM_UNSHUFFLE_RSRC_ID (id );
582
-
583
- tsrm_mutex_lock (tsmm_mutex );
584
-
585
- if (tsrm_tls_table && resource_types_table ) {
586
- for (int i = 0 ; i < tsrm_tls_table_size ; i ++ ) {
587
- tsrm_tls_entry * p = tsrm_tls_table [i ];
588
-
589
- while (p ) {
590
- if (p -> count > rsrc_id && p -> storage [rsrc_id ]) {
591
- cb (p -> storage [rsrc_id ]);
592
- }
593
- p = p -> next ;
594
- }
595
- }
596
- }
597
-
598
- tsrm_mutex_unlock (tsmm_mutex );
599
- }
600
579
601
580
/*
602
581
* Utility Functions
Original file line number Diff line number Diff line change @@ -104,9 +104,6 @@ TSRM_API void ts_free_thread(void);
104
104
/* deallocates all occurrences of a given id */
105
105
TSRM_API void ts_free_id (ts_rsrc_id id );
106
106
107
- /* Runs a callback on all resources of the given id.
108
- * The caller is responsible for ensuring the underlying resources don't data-race. */
109
- TSRM_API void ts_apply_for_id (ts_rsrc_id id , void (* cb )(void * ));
110
107
111
108
/* Debug support */
112
109
#define TSRM_ERROR_LEVEL_ERROR 1
Original file line number Diff line number Diff line change @@ -826,19 +826,13 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{
826
826
}
827
827
/* }}} */
828
828
829
- static void executor_globals_persistent_list_dtor ( void * storage )
829
+ static void executor_globals_dtor ( zend_executor_globals * executor_globals ) /* {{{ */
830
830
{
831
- zend_executor_globals * executor_globals = storage ;
831
+ zend_ini_dtor ( executor_globals -> ini_directives ) ;
832
832
833
833
if (& executor_globals -> persistent_list != global_persistent_list ) {
834
834
zend_destroy_rsrc_list (& executor_globals -> persistent_list );
835
835
}
836
- }
837
-
838
- static void executor_globals_dtor (zend_executor_globals * executor_globals ) /* {{{ */
839
- {
840
- zend_ini_dtor (executor_globals -> ini_directives );
841
-
842
836
if (executor_globals -> zend_constants != GLOBAL_CONSTANTS_TABLE ) {
843
837
zend_hash_destroy (executor_globals -> zend_constants );
844
838
free (executor_globals -> zend_constants );
@@ -1128,9 +1122,6 @@ void zend_shutdown(void) /* {{{ */
1128
1122
zend_vm_dtor ();
1129
1123
1130
1124
zend_destroy_rsrc_list (& EG (persistent_list ));
1131
- #ifdef ZTS
1132
- ts_apply_for_id (executor_globals_id , executor_globals_persistent_list_dtor );
1133
- #endif
1134
1125
zend_destroy_modules ();
1135
1126
1136
1127
virtual_cwd_deactivate ();
Original file line number Diff line number Diff line change @@ -168,7 +168,13 @@ static void _close_odbc_conn(zend_resource *rsrc)
168
168
SQLFreeEnv (conn -> henv );
169
169
}
170
170
efree (conn );
171
- ODBCG (num_links )-- ;
171
+ /* See https://github.com/php/php-src/issues/12974 why we need to check the if */
172
+ #ifdef ZTS
173
+ if (odbc_module_entry .module_started )
174
+ #endif
175
+ {
176
+ ODBCG (num_links )-- ;
177
+ }
172
178
}
173
179
/* }}} */
174
180
Original file line number Diff line number Diff line change @@ -315,8 +315,14 @@ static void _close_pgsql_plink(zend_resource *rsrc)
315
315
PQclear (res );
316
316
}
317
317
PQfinish (link );
318
- PGG (num_persistent )-- ;
319
- PGG (num_links )-- ;
318
+ /* See https://github.com/php/php-src/issues/12974 why we need to check the if */
319
+ #ifdef ZTS
320
+ if (pgsql_module_entry .module_started )
321
+ #endif
322
+ {
323
+ PGG (num_persistent )-- ;
324
+ PGG (num_links )-- ;
325
+ }
320
326
rsrc -> ptr = NULL ;
321
327
}
322
328
You can’t perform that action at this time.
0 commit comments