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
4e74fdce
Commit
4e74fdce
authored
Jul 19, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Free outstanding advise requests when destroying a system clock.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ff231dad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
systemclock.c
dlls/quartz/systemclock.c
+8
-0
systemclock.c
dlls/quartz/tests/systemclock.c
+10
-2
No files found.
dlls/quartz/systemclock.c
View file @
4e74fdce
...
...
@@ -90,6 +90,7 @@ static ULONG WINAPI system_clock_inner_Release(IUnknown *iface)
{
struct
system_clock
*
clock
=
impl_from_IUnknown
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
clock
->
refcount
);
struct
advise_sink
*
sink
,
*
cursor
;
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
clock
,
refcount
);
...
...
@@ -104,6 +105,13 @@ static ULONG WINAPI system_clock_inner_Release(IUnknown *iface)
WaitForSingleObject
(
clock
->
thread
,
INFINITE
);
CloseHandle
(
clock
->
thread
);
}
LIST_FOR_EACH_ENTRY_SAFE
(
sink
,
cursor
,
&
clock
->
sinks
,
struct
advise_sink
,
entry
)
{
list_remove
(
&
sink
->
entry
);
heap_free
(
sink
);
}
clock
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
clock
->
cs
);
heap_free
(
clock
);
...
...
dlls/quartz/tests/systemclock.c
View file @
4e74fdce
...
...
@@ -272,11 +272,19 @@ static void test_advise(void)
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
WaitForSingleObject
(
semaphore
,
200
)
==
WAIT_TIMEOUT
,
"Semaphore should not be signaled.
\n
"
);
CloseHandle
(
event
);
CloseHandle
(
semaphore
);
ResetEvent
(
event
);
hr
=
IReferenceClock_GetTime
(
clock
,
&
current
);
ok
(
SUCCEEDED
(
hr
),
"Got hr %#x.
\n
"
,
hr
);
hr
=
IReferenceClock_AdviseTime
(
clock
,
current
,
500
*
10000
,
(
HEVENT
)
event
,
&
cookie
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
IReferenceClock_Release
(
clock
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ok
(
WaitForSingleObject
(
event
,
0
)
==
WAIT_TIMEOUT
,
"Event should not be signaled.
\n
"
);
CloseHandle
(
event
);
CloseHandle
(
semaphore
);
}
START_TEST
(
systemclock
)
...
...
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