Skip to content

Commit 013dcab

Browse files
committed
Merge branch 'PHP-7.4' into master
* PHP-7.4: Fix #48585: com_load_typelib holds reference, fails on second call
2 parents dd85846 + 183b853 commit 013dcab

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

ext/com_dotnet/com_com.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ PHP_METHOD(com, __construct)
244244
TL = php_com_load_typelib_via_cache(typelib_name, obj->code_page, &cached);
245245

246246
if (TL) {
247-
if (COMG(autoreg_on) && !cached) {
247+
if (COMG(autoreg_on)) {
248248
php_com_import_typelib(TL, mode, obj->code_page);
249249
}
250250

@@ -834,9 +834,7 @@ PHP_FUNCTION(com_load_typelib)
834834
php_com_initialize();
835835
pTL = php_com_load_typelib_via_cache(name, codepage, &cached);
836836
if (pTL) {
837-
if (cached) {
838-
RETVAL_TRUE;
839-
} else if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage) == SUCCESS) {
837+
if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage) == SUCCESS) {
840838
RETVAL_TRUE;
841839
}
842840

ext/com_dotnet/com_extension.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ static PHP_INI_MH(OnTypeLibFileUpdate)
115115
}
116116

117117
if ((pTL = php_com_load_typelib_via_cache(typelib_name, COMG(code_page), &cached)) != NULL) {
118-
if (!cached) {
119-
php_com_import_typelib(pTL, mode, COMG(code_page));
120-
}
118+
php_com_import_typelib(pTL, mode, COMG(code_page));
121119
ITypeLib_Release(pTL);
122120
}
123121
}

0 commit comments

Comments
 (0)