Skip to content

Commit 7052dc7

Browse files
committed
Convert to the modern (7.3) persistent resource API
1 parent ddfff11 commit 7052dc7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ibm_db2.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2694,11 +2694,7 @@ static int _php_db2_connect_helper( INTERNAL_FUNCTION_PARAMETERS, conn_handle **
26942694
if (hKey != NULL) {
26952695
if (! reused && rc == SQL_SUCCESS) {
26962696
/* If we created a new persistent connection, add it to the persistent_list */
2697-
zend_resource newPersistentRes;
2698-
newPersistentRes.type = le_pconn_struct;
2699-
newPersistentRes.ptr = conn_res;
2700-
GC_SET_REFCOUNT(&newPersistentRes, 1);
2701-
if (zend_hash_str_update_mem(&EG(persistent_list), hKey, hKeyLen, &newPersistentRes, sizeof(newPersistentRes)) == NULL) {
2697+
if (zend_register_persistent_resource(hKey, hKeyLen, conn_res, le_pconn_struct) == NULL) {
27022698
rc = SQL_ERROR;
27032699
/* TBD: What error to return?, for now just generic SQL_ERROR */
27042700
}

0 commit comments

Comments
 (0)