File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed 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