mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
IDispatchs got released if they were passed to another component
This commit is contained in:
parent
3b52256bd1
commit
d1a2dbfd9d
2 changed files with 22 additions and 2 deletions
|
@ -511,6 +511,12 @@ PHP_FUNCTION(com_load)
|
||||||
/* @todo if (server_name) */
|
/* @todo if (server_name) */
|
||||||
|
|
||||||
if (!server_name) {
|
if (!server_name) {
|
||||||
|
/* @todo shouldn't the bind context be fetched on module startup and kept as a global shared instance ?
|
||||||
|
* all calls to BindToObject would deliver the same instance then (as desired)
|
||||||
|
* IBindCtx::RegisterObjectBound() should be called then after mkparsedisplayname()
|
||||||
|
*
|
||||||
|
* @todo use mkparsedisplaynameex() ?
|
||||||
|
*/
|
||||||
if (SUCCEEDED(hr = CreateBindCtx(0, &pBindCtx))) {
|
if (SUCCEEDED(hr = CreateBindCtx(0, &pBindCtx))) {
|
||||||
if (SUCCEEDED(hr = MkParseDisplayName(pBindCtx, ProgID, &ulEaten, &pMoniker))) {
|
if (SUCCEEDED(hr = MkParseDisplayName(pBindCtx, ProgID, &ulEaten, &pMoniker))) {
|
||||||
hr = pMoniker->lpVtbl->BindToObject(pMoniker, pBindCtx, NULL, &IID_IDispatch, (LPVOID *) &C_DISPATCH(obj));
|
hr = pMoniker->lpVtbl->BindToObject(pMoniker, pBindCtx, NULL, &IID_IDispatch, (LPVOID *) &C_DISPATCH(obj));
|
||||||
|
@ -742,7 +748,11 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval **
|
||||||
|
|
||||||
efree(funcname);
|
efree(funcname);
|
||||||
for (current_arg=0;current_arg<arg_count;current_arg++) {
|
for (current_arg=0;current_arg<arg_count;current_arg++) {
|
||||||
VariantClear(&variant_args[current_arg]);
|
/* don't release IDispatch pointers as they are used afterwards */
|
||||||
|
if (V_VT(&variant_args[current_arg]) != VT_DISPATCH) {
|
||||||
|
/* @todo review this: what happens to an array of IDispatchs or a VARIANT->IDispatch */
|
||||||
|
VariantClear(&variant_args[current_arg]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
efree(variant_args);
|
efree(variant_args);
|
||||||
|
|
||||||
|
|
|
@ -511,6 +511,12 @@ PHP_FUNCTION(com_load)
|
||||||
/* @todo if (server_name) */
|
/* @todo if (server_name) */
|
||||||
|
|
||||||
if (!server_name) {
|
if (!server_name) {
|
||||||
|
/* @todo shouldn't the bind context be fetched on module startup and kept as a global shared instance ?
|
||||||
|
* all calls to BindToObject would deliver the same instance then (as desired)
|
||||||
|
* IBindCtx::RegisterObjectBound() should be called then after mkparsedisplayname()
|
||||||
|
*
|
||||||
|
* @todo use mkparsedisplaynameex() ?
|
||||||
|
*/
|
||||||
if (SUCCEEDED(hr = CreateBindCtx(0, &pBindCtx))) {
|
if (SUCCEEDED(hr = CreateBindCtx(0, &pBindCtx))) {
|
||||||
if (SUCCEEDED(hr = MkParseDisplayName(pBindCtx, ProgID, &ulEaten, &pMoniker))) {
|
if (SUCCEEDED(hr = MkParseDisplayName(pBindCtx, ProgID, &ulEaten, &pMoniker))) {
|
||||||
hr = pMoniker->lpVtbl->BindToObject(pMoniker, pBindCtx, NULL, &IID_IDispatch, (LPVOID *) &C_DISPATCH(obj));
|
hr = pMoniker->lpVtbl->BindToObject(pMoniker, pBindCtx, NULL, &IID_IDispatch, (LPVOID *) &C_DISPATCH(obj));
|
||||||
|
@ -742,7 +748,11 @@ int do_COM_invoke(comval *obj, pval *function_name, VARIANT *var_result, pval **
|
||||||
|
|
||||||
efree(funcname);
|
efree(funcname);
|
||||||
for (current_arg=0;current_arg<arg_count;current_arg++) {
|
for (current_arg=0;current_arg<arg_count;current_arg++) {
|
||||||
VariantClear(&variant_args[current_arg]);
|
/* don't release IDispatch pointers as they are used afterwards */
|
||||||
|
if (V_VT(&variant_args[current_arg]) != VT_DISPATCH) {
|
||||||
|
/* @todo review this: what happens to an array of IDispatchs or a VARIANT->IDispatch */
|
||||||
|
VariantClear(&variant_args[current_arg]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
efree(variant_args);
|
efree(variant_args);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue