Skip to content

Commit 2e0c011

Browse files
authored
zend_objects: Remove unnecessary refcounting when calling __clone() (#19145)
Found as part of the clone-with review in #18747.
1 parent 6274299 commit 2e0c011

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Zend/zend_objects.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ ZEND_API void ZEND_FASTCALL zend_objects_clone_members(zend_object *new_object,
264264
}
265265

266266
if (has_clone_method) {
267-
GC_ADDREF(new_object);
268267
zend_call_known_instance_method_with_0_params(new_object->ce->clone, new_object, NULL);
269268

270269
if (ZEND_CLASS_HAS_READONLY_PROPS(new_object->ce)) {
@@ -274,8 +273,6 @@ ZEND_API void ZEND_FASTCALL zend_objects_clone_members(zend_object *new_object,
274273
Z_PROP_FLAG_P(prop) &= ~IS_PROP_REINITABLE;
275274
}
276275
}
277-
278-
OBJ_RELEASE(new_object);
279276
}
280277
}
281278

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy