Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d6ccaa43
Commit
d6ccaa43
authored
Oct 14, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 15, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added ref counting to node object.
parent
71894ead
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
htmlnode.c
dlls/mshtml/htmlnode.c
+14
-6
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
No files found.
dlls/mshtml/htmlnode.c
View file @
d6ccaa43
...
...
@@ -50,19 +50,26 @@ static HRESULT WINAPI HTMLDOMNode_QueryInterface(IHTMLDOMNode *iface,
static
ULONG
WINAPI
HTMLDOMNode_AddRef
(
IHTMLDOMNode
*
iface
)
{
HTMLDOMNode
*
This
=
HTMLDOMNODE_THIS
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)
\n
"
,
This
);
TRACE
(
"(%p)
ref=%d
\n
"
,
This
,
ref
);
return
IHTMLDocument2_AddRef
(
HTMLDOC
(
This
->
doc
))
;
return
ref
;
}
static
ULONG
WINAPI
HTMLDOMNode_Release
(
IHTMLDOMNode
*
iface
)
{
HTMLDOMNode
*
This
=
HTMLDOMNODE_THIS
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)
\n
"
,
This
);
TRACE
(
"(%p)
ref=%d
\n
"
,
This
,
ref
);
return
IHTMLDocument2_Release
(
HTMLDOC
(
This
->
doc
));
if
(
!
ref
)
{
This
->
vtbl
->
destructor
(
This
);
mshtml_free
(
This
);
}
return
ref
;
}
static
HRESULT
WINAPI
HTMLDOMNode_GetTypeInfoCount
(
IHTMLDOMNode
*
iface
,
UINT
*
pctinfo
)
...
...
@@ -352,6 +359,7 @@ static HTMLDOMNode *create_node(HTMLDocument *doc, nsIDOMNode *nsnode)
}
ret
->
lpHTMLDOMNodeVtbl
=
&
HTMLDOMNodeVtbl
;
ret
->
ref
=
1
;
ret
->
doc
=
doc
;
nsIDOMNode_AddRef
(
nsnode
);
...
...
@@ -396,7 +404,7 @@ void release_nodes(HTMLDocument *This)
for
(
iter
=
This
->
nodes
;
iter
;
iter
=
next
)
{
next
=
iter
->
next
;
iter
->
vtbl
->
destructor
(
iter
)
;
mshtml_free
(
iter
);
iter
->
doc
=
NULL
;
IHTMLDOMNode_Release
(
HTMLDOMNODE
(
iter
)
);
}
}
dlls/mshtml/mshtml_private.h
View file @
d6ccaa43
...
...
@@ -270,6 +270,8 @@ struct HTMLDOMNode {
const
IHTMLDOMNodeVtbl
*
lpHTMLDOMNodeVtbl
;
const
NodeImplVtbl
*
vtbl
;
LONG
ref
;
nsIDOMNode
*
nsnode
;
HTMLDocument
*
doc
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment