mshtml: Remove selection and range objects from document list when detaching.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-03-21 14:40:44 +01:00 committed by Alexandre Julliard
parent 18e0225afb
commit a124117f40
2 changed files with 6 additions and 4 deletions

View File

@ -364,9 +364,10 @@ HRESULT HTMLSelectionObject_Create(HTMLDocumentNode *doc, nsISelection *nsselect
void detach_selection(HTMLDocumentNode *This) void detach_selection(HTMLDocumentNode *This)
{ {
HTMLSelectionObject *iter; HTMLSelectionObject *iter, *next;
LIST_FOR_EACH_ENTRY(iter, &This->selection_list, HTMLSelectionObject, entry) { LIST_FOR_EACH_ENTRY_SAFE(iter, next, &This->selection_list, HTMLSelectionObject, entry) {
iter->doc = NULL; iter->doc = NULL;
list_remove(&iter->entry);
} }
} }

View File

@ -1760,9 +1760,10 @@ HRESULT HTMLTxtRange_Create(HTMLDocumentNode *doc, nsIDOMRange *nsrange, IHTMLTx
void detach_ranges(HTMLDocumentNode *This) void detach_ranges(HTMLDocumentNode *This)
{ {
HTMLTxtRange *iter; HTMLTxtRange *iter, *next;
LIST_FOR_EACH_ENTRY(iter, &This->range_list, HTMLTxtRange, entry) { LIST_FOR_EACH_ENTRY_SAFE(iter, next, &This->range_list, HTMLTxtRange, entry) {
iter->doc = NULL; iter->doc = NULL;
list_remove(&iter->entry);
} }
} }