Skip to content

Commit 4b9cb6c

Browse files
committed
Fix FFI caching
1 parent 40899af commit 4b9cb6c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ext/ffi/ffi.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,12 +2312,12 @@ static void zend_ffi_free_obj(zend_object *object) /* {{{ */
23122312
ffi->lib = NULL;
23132313
}
23142314

2315-
if (ffi->symbols) {
2315+
if (ffi->symbols && !(GC_FLAGS(ffi->symbols) & IS_ARRAY_IMMUTABLE)) {
23162316
zend_hash_destroy(ffi->symbols);
23172317
efree(ffi->symbols);
23182318
}
23192319

2320-
if (ffi->tags) {
2320+
if (ffi->tags && !(GC_FLAGS(ffi->tags) & IS_ARRAY_IMMUTABLE)) {
23212321
zend_hash_destroy(ffi->tags);
23222322
efree(ffi->tags);
23232323
}
@@ -3496,7 +3496,6 @@ static zend_ffi *zend_ffi_load(const char *filename, bool preload) /* {{{ */
34963496
}
34973497
FFI_G(symbols) = cached_scope->symbols;
34983498
FFI_G(tags) = cached_scope->tags;
3499-
persistent = true;
35003499
}
35013500
}
35023501

0 commit comments

Comments
 (0)