Skip to content

Commit d0c8206

Browse files
committed
Fix
1 parent 460aa36 commit d0c8206

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

php_phongo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static HashTable* php_phongo_std_get_gc(zend_object* object, zval** table, int*
159159
{
160160
*table = NULL;
161161
*n = 0;
162-
return zend_std_get_properties(object);
162+
return object->handlers->get_properties(object);
163163
}
164164

165165
PHP_MINIT_FUNCTION(mongodb) /* {{{ */

php_phongo.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,28 @@ ZEND_TSRMLS_CACHE_EXTERN()
6060

6161
zend_object_handlers* phongo_get_std_object_handlers(void);
6262

63+
#define PHONGO_GET_PROPERTY_HASH_INIT_PROPS(is_temp, intern, props, size) \
64+
do { \
65+
if (is_temp) { \
66+
ALLOC_HASHTABLE(props); \
67+
zend_hash_init((props), (size), NULL, ZVAL_PTR_DTOR, 0); \
68+
} else if ((intern)->properties) { \
69+
(props) = (intern)->properties; \
70+
} else { \
71+
ALLOC_HASHTABLE(props); \
72+
zend_hash_init((props), (size), NULL, ZVAL_PTR_DTOR, 0); \
73+
(intern)->properties = (props); \
74+
} \
75+
} while (0)
76+
77+
#define PHONGO_GET_PROPERTY_HASH_FREE_PROPS(is_temp, props) \
78+
do { \
79+
if (is_temp) { \
80+
zend_hash_destroy((props)); \
81+
FREE_HASHTABLE(props); \
82+
} \
83+
} while (0)
84+
6385
#define PHONGO_ZVAL_EXCEPTION_NAME(e) (ZSTR_VAL(e->ce->name))
6486

6587
#define PHONGO_SET_CREATED_BY_PID(intern) \

0 commit comments

Comments
 (0)