Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1cad1646
Commit
1cad1646
authored
Jan 13, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3/xmldoc: Don't leak document and stream on next IXMLDocument::Load().
parent
6c1275a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
xmldoc.c
dlls/msxml3/tests/xmldoc.c
+8
-0
xmldoc.c
dlls/msxml3/xmldoc.c
+6
-0
No files found.
dlls/msxml3/tests/xmldoc.c
View file @
1cad1646
...
...
@@ -431,6 +431,14 @@ static void test_persiststreaminit(void)
hr
=
IPersistStreamInit_IsDirty
(
psi
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Expected S_FALSE, got %08x
\n
"
,
hr
);
create_stream_on_file
(
&
stream
,
path
);
hr
=
IPersistStreamInit_Load
(
psi
,
stream
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
IStream_Release
(
stream
);
hr
=
IPersistStreamInit_IsDirty
(
psi
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Expected S_FALSE, got %08x
\n
"
,
hr
);
/* reset internal stream */
hr
=
IPersistStreamInit_InitNew
(
psi
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
...
...
dlls/msxml3/xmldoc.c
View file @
1cad1646
...
...
@@ -616,6 +616,8 @@ static HRESULT WINAPI xmldoc_IPersistStreamInit_Load(
if
(
!
pStm
)
return
E_INVALIDARG
;
/* release previously allocated stream */
if
(
This
->
stream
)
IStream_Release
(
This
->
stream
);
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
This
->
stream
);
if
(
FAILED
(
hr
))
return
hr
;
...
...
@@ -639,7 +641,10 @@ static HRESULT WINAPI xmldoc_IPersistStreamInit_Load(
len
=
GlobalSize
(
hglobal
);
ptr
=
GlobalLock
(
hglobal
);
if
(
len
!=
0
)
{
xmlFreeDoc
(
This
->
xmldoc
);
This
->
xmldoc
=
parse_xml
(
ptr
,
len
);
}
GlobalUnlock
(
hglobal
);
if
(
!
This
->
xmldoc
)
...
...
@@ -648,6 +653,7 @@ static HRESULT WINAPI xmldoc_IPersistStreamInit_Load(
return
E_FAIL
;
}
if
(
This
->
root
)
IXMLElement_Release
(
This
->
root
);
xmlnode
=
xmlDocGetRootElement
(
This
->
xmldoc
);
return
XMLElement_create
((
IUnknown
*
)
This
,
xmlnode
,
(
LPVOID
*
)
&
This
->
root
);
}
...
...
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