vbscript: Properly release global variables.
This commit is contained in:
parent
84d5a39659
commit
6f0e215fb5
|
@ -1561,11 +1561,20 @@ OP_LIST
|
|||
#undef X
|
||||
};
|
||||
|
||||
void release_dynamic_vars(dynamic_var_t *var)
|
||||
{
|
||||
while(var) {
|
||||
VariantClear(&var->v);
|
||||
var = var->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void release_exec(exec_ctx_t *ctx)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
VariantClear(&ctx->ret_val);
|
||||
release_dynamic_vars(ctx->dynamic_vars);
|
||||
|
||||
if(ctx->this_obj)
|
||||
IDispatch_Release(ctx->this_obj);
|
||||
|
|
|
@ -114,6 +114,9 @@ static void release_script(script_ctx_t *ctx)
|
|||
{
|
||||
collect_objects(ctx);
|
||||
|
||||
release_dynamic_vars(ctx->global_vars);
|
||||
ctx->global_vars = NULL;
|
||||
|
||||
while(!list_empty(&ctx->named_items)) {
|
||||
named_item_t *iter = LIST_ENTRY(list_head(&ctx->named_items), named_item_t, entry);
|
||||
|
||||
|
|
|
@ -309,6 +309,7 @@ struct _vbscode_t {
|
|||
void release_vbscode(vbscode_t*) DECLSPEC_HIDDEN;
|
||||
HRESULT compile_script(script_ctx_t*,const WCHAR*,vbscode_t**) DECLSPEC_HIDDEN;
|
||||
HRESULT exec_script(script_ctx_t*,function_t*,IDispatch*,DISPPARAMS*,VARIANT*) DECLSPEC_HIDDEN;
|
||||
void release_dynamic_vars(dynamic_var_t*) DECLSPEC_HIDDEN;
|
||||
|
||||
#define TID_LIST \
|
||||
XDIID(ErrObj) \
|
||||
|
|
Loading…
Reference in New Issue