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
1b4f3ca6
Commit
1b4f3ca6
authored
Apr 18, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Merge release code to Release method.
parent
a06db6cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
42 deletions
+18
-42
stg_stream.c
dlls/ole32/stg_stream.c
+18
-42
No files found.
dlls/ole32/stg_stream.c
View file @
1b4f3ca6
...
...
@@ -43,40 +43,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
storage
);
/***
* This is the destructor of the StgStreamImpl class.
*
* This method will clean-up all the resources used-up by the given StgStreamImpl
* class. The pointer passed-in to this function will be freed and will not
* be valid anymore.
*/
static
void
StgStreamImpl_Destroy
(
StgStreamImpl
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
/*
* Release the reference we are holding on the parent storage.
* IStorage_Release(&This->parentStorage->IStorage_iface);
*
* No, don't do this. Some apps call IStorage_Release without
* calling IStream_Release first. If we grab a reference the
* file is not closed, and the app fails when it tries to
* reopen the file (Easy-PC, for example). Just inform the
* storage that we have closed the stream
*/
if
(
This
->
parentStorage
)
{
StorageBaseImpl_RemoveStream
(
This
->
parentStorage
,
This
);
}
This
->
parentStorage
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
/***
* This implements the IUnknown method QueryInterface for this
* class
...
...
@@ -126,17 +92,27 @@ static ULONG WINAPI StgStreamImpl_Release(
IStream
*
iface
)
{
StgStreamImpl
*
This
=
impl_from_IStream
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
;
if
(
!
ref
)
{
TRACE
(
"(%p)
\n
"
,
This
);
ref
=
InterlockedDecrement
(
&
This
->
ref
);
/*
* Release the reference we are holding on the parent storage.
* IStorage_Release(&This->parentStorage->IStorage_iface);
*
* No, don't do this. Some apps call IStorage_Release without
* calling IStream_Release first. If we grab a reference the
* file is not closed, and the app fails when it tries to
* reopen the file (Easy-PC, for example). Just inform the
* storage that we have closed the stream
*/
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
ref
==
0
)
{
StgStreamImpl_Destroy
(
This
);
if
(
This
->
parentStorage
)
StorageBaseImpl_RemoveStream
(
This
->
parentStorage
,
This
);
This
->
parentStorage
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
...
...
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