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
19eba06a
Commit
19eba06a
authored
May 31, 2014
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Don't leak memory on IReferenceClock creation failure.
Also lock/unlock the module only on creation/destruction of the object.
parent
57eb95a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
clock.c
dlls/dmusic/clock.c
+10
-7
No files found.
dlls/dmusic/clock.c
View file @
19eba06a
...
...
@@ -50,8 +50,6 @@ static ULONG WINAPI IReferenceClockImpl_AddRef(IReferenceClock *iface)
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
This
,
ref
);
DMUSIC_LockModule
();
return
ref
;
}
...
...
@@ -62,10 +60,10 @@ static ULONG WINAPI IReferenceClockImpl_Release(IReferenceClock *iface)
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
This
,
ref
);
if
(
!
ref
)
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
DMUSIC_UnlockModule
();
DMUSIC_UnlockModule
();
}
return
ref
;
}
...
...
@@ -123,6 +121,7 @@ static const IReferenceClockVtbl ReferenceClock_Vtbl = {
HRESULT
DMUSIC_CreateReferenceClockImpl
(
LPCGUID
riid
,
LPVOID
*
ret_iface
,
LPUNKNOWN
unkouter
)
{
IReferenceClockImpl
*
clock
;
HRESULT
hr
;
TRACE
(
"(%p,%p,%p)
\n
"
,
riid
,
ret_iface
,
unkouter
);
...
...
@@ -133,9 +132,13 @@ HRESULT DMUSIC_CreateReferenceClockImpl(LPCGUID riid, LPVOID* ret_iface, LPUNKNO
}
clock
->
IReferenceClock_iface
.
lpVtbl
=
&
ReferenceClock_Vtbl
;
clock
->
ref
=
0
;
/* Will be inited by QueryInterface */
clock
->
ref
=
1
;
clock
->
rtTime
=
0
;
clock
->
pClockInfo
.
dwSize
=
sizeof
(
DMUS_CLOCKINFO
);
return
IReferenceClockImpl_QueryInterface
((
IReferenceClock
*
)
clock
,
riid
,
ret_iface
);
DMUSIC_LockModule
();
hr
=
IReferenceClockImpl_QueryInterface
(
&
clock
->
IReferenceClock_iface
,
riid
,
ret_iface
);
IReferenceClockImpl_Release
(
&
clock
->
IReferenceClock_iface
);
return
hr
;
}
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