Skip to content

Commit 183b853

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #48585: com_load_typelib holds reference, fails on second call
2 parents 66d9f4d + dc108fe commit 183b853

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ PHP NEWS
1414
. Fixed bug #79947 (Memory leak on invalid offset type in compound
1515
assignment). (Nikita)
1616

17+
- COM:
18+
. Fixed bug #48585 (com_load_typelib holds reference, fails on second call).
19+
(cmb)
20+
1721
- Gettext:
1822
. Fixed bug #70574 (Tests fail due to relying on Linux fallback behavior for
1923
gettext()). (Florian Engelhardt)

ext/com_dotnet/com_com.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ PHP_FUNCTION(com_create_instance)
248248
TL = php_com_load_typelib_via_cache(typelib_name, obj->code_page, &cached);
249249

250250
if (TL) {
251-
if (COMG(autoreg_on) && !cached) {
251+
if (COMG(autoreg_on)) {
252252
php_com_import_typelib(TL, mode, obj->code_page);
253253
}
254254

@@ -840,9 +840,7 @@ PHP_FUNCTION(com_load_typelib)
840840
php_com_initialize();
841841
pTL = php_com_load_typelib_via_cache(name, codepage, &cached);
842842
if (pTL) {
843-
if (cached) {
844-
RETVAL_TRUE;
845-
} else if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage) == SUCCESS) {
843+
if (php_com_import_typelib(pTL, cs ? CONST_CS : 0, codepage) == SUCCESS) {
846844
RETVAL_TRUE;
847845
}
848846

ext/com_dotnet/com_extension.c

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

253253
if ((pTL = php_com_load_typelib_via_cache(typelib_name, COMG(code_page), &cached)) != NULL) {
254-
if (!cached) {
255-
php_com_import_typelib(pTL, mode, COMG(code_page));
256-
}
254+
php_com_import_typelib(pTL, mode, COMG(code_page));
257255
ITypeLib_Release(pTL);
258256
}
259257
}

0 commit comments

Comments
 (0)