aboutsummaryrefslogtreecommitdiff
path: root/php/ext/google/protobuf/map.c
diff options
context:
space:
mode:
authorAdam Cozzette <acozzette@gmail.com>2018-08-01 14:56:08 -0700
committerGitHub <noreply@github.com>2018-08-01 14:56:08 -0700
commit21fc01b63c7f60bae4e230c817a82bd8571a4a70 (patch)
tree20730e597f914fd2430c66b9bebe633e017a4fe0 /php/ext/google/protobuf/map.c
parent3d62db3ecd5377025a458bca827ab4ca12d5c1f0 (diff)
parent94d55e529204cc8575bf1070dc1e2375dbc8a4c5 (diff)
downloadprotobuf-21fc01b63c7f60bae4e230c817a82bd8571a4a70.tar.gz
protobuf-21fc01b63c7f60bae4e230c817a82bd8571a4a70.tar.bz2
protobuf-21fc01b63c7f60bae4e230c817a82bd8571a4a70.zip
Merge pull request #4991 from acozzette/merge-3-6-x
Merge 3.6.x branch into master
Diffstat (limited to 'php/ext/google/protobuf/map.c')
-rw-r--r--php/ext/google/protobuf/map.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/php/ext/google/protobuf/map.c b/php/ext/google/protobuf/map.c
index ab8a518a..c5b500b5 100644
--- a/php/ext/google/protobuf/map.c
+++ b/php/ext/google/protobuf/map.c
@@ -192,7 +192,8 @@ static inline void php_proto_map_string_release(void *value) {
}
static inline void php_proto_map_object_release(void *value) {
zend_object* object = *(zend_object**)value;
- if(--GC_REFCOUNT(object) == 0) {
+ GC_DELREF(object);
+ if(GC_REFCOUNT(object) == 0) {
zend_objects_store_del(object);
}
}
@@ -302,7 +303,8 @@ static bool map_index_unset(Map *intern, const char* keyval, int length) {
zval_ptr_dtor(upb_value_memory(&old_value));
#else
zend_object* object = *(zend_object**)upb_value_memory(&old_value);
- if(--GC_REFCOUNT(object) == 0) {
+ GC_DELREF(object);
+ if(GC_REFCOUNT(object) == 0) {
zend_objects_store_del(object);
}
#endif