static ULONG WINAPI RegExp2_Release(IRegExp2 *iface) { RegExp2 *This = impl_from_IRegExp2(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); if(!ref) { heap_free(This->pattern); if(This->regexp) regexp_destroy(This->regexp); heap_pool_free(&This->pool); heap_free(This); } return ref; }
void script_release(script_ctx_t *ctx) { if(--ctx->ref) return; clear_ei(ctx); if(ctx->cc) release_cc(ctx->cc); heap_pool_free(&ctx->tmp_heap); if(ctx->last_match) jsstr_release(ctx->last_match); ctx->jscaller->ctx = NULL; IServiceProvider_Release(&ctx->jscaller->IServiceProvider_iface); heap_free(ctx); }