From 7b48298e2755a18a7782aac87f06ce880e9c1e0a Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 27 Mar 2008 19:08:07 +0100 Subject: [PATCH] mshtml: Don't access released object in release_script_hosts. --- dlls/mshtml/script.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c index 6433ac00428..40509f38aa7 100644 --- a/dlls/mshtml/script.c +++ b/dlls/mshtml/script.c @@ -304,8 +304,11 @@ void release_script_hosts(HTMLDocument *doc) { ScriptHost *iter; - LIST_FOR_EACH_ENTRY(iter, &doc->script_hosts, ScriptHost, entry) { + while(!list_empty(&doc->script_hosts)) { + iter = LIST_ENTRY(list_head(&doc->script_hosts), ScriptHost, entry); + + list_remove(&iter->entry); iter->doc = NULL; - IActiveScriptSite_Release(ACTSCPSITE(iter)); + IActiveScript_Release(ACTSCPSITE(iter)); } }