summaryrefslogtreecommitdiff
path: root/ext/com/conversion.c
diff options
context:
space:
mode:
authorHarald Radi <phanto@php.net>2001-06-05 22:09:58 +0000
committerHarald Radi <phanto@php.net>2001-06-05 22:09:58 +0000
commitde780b345ca735c4ae8da1a6086db8437ae97661 (patch)
tree1e5b885d7296a3fc4898fcaed6d9e58b5ca9cfb8 /ext/com/conversion.c
parentf8a697e2e8d9119eb96d8d039eec9848e53de4c1 (diff)
downloadphp-git-de780b345ca735c4ae8da1a6086db8437ae97661.tar.gz
bugfix: collections didn't work correctly
Diffstat (limited to 'ext/com/conversion.c')
-rw-r--r--ext/com/conversion.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/com/conversion.c b/ext/com/conversion.c
index a352f0185d..a105fb2e1b 100644
--- a/ext/com/conversion.c
+++ b/ext/com/conversion.c
@@ -403,6 +403,8 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
/* seemed like the smallest impact on unfamiliar code */
int ret = SUCCESS;
+ INIT_PZVAL(pval_arg);
+
/* Add SafeArray support */
if (var_arg->vt & VT_ARRAY)
{
@@ -679,21 +681,19 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int persistent,
}
else
{
+ obj = emalloc(sizeof(i_dispatch));
+ php_COM_set(obj, var_arg->pdispVal, TRUE);
+
pval_arg->type = IS_OBJECT;
pval_arg->value.obj.ce = &com_class_entry;
pval_arg->value.obj.properties = (HashTable *) emalloc(sizeof(HashTable));
- pval_arg->is_ref = 1;
- pval_arg->refcount = 1;
zend_hash_init(pval_arg->value.obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
ALLOC_ZVAL(handle);
- obj = emalloc(sizeof(i_dispatch));
- php_COM_set(obj, var_arg->pdispVal, TRUE);
+ INIT_PZVAL(handle);
+ ZVAL_LONG(handle, zend_list_insert(obj, php_COM_get_le_idispatch()));
- handle->type = IS_LONG;
- handle->value.lval = zend_list_insert(obj, php_COM_get_le_idispatch());
pval_copy_constructor(handle);
- INIT_PZVAL(handle);
zend_hash_index_update(pval_arg->value.obj.properties, 0, &handle, sizeof(pval *), NULL);
}
}