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
0966d613
Commit
0966d613
authored
Oct 10, 2005
by
Robert Reif
Committed by
Alexandre Julliard
Oct 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DirectSoundDevice reference count cleanup.
parent
cdec2ee7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
dsound.c
dlls/dsound/dsound.c
+14
-7
No files found.
dlls/dsound/dsound.c
View file @
0966d613
...
...
@@ -45,6 +45,7 @@ static ULONG WINAPI IDirectSound8_IDirectSound_AddRef(LPDIRECTSOUND iface);
static
ULONG
WINAPI
IDirectSound8_IDirectSound8_AddRef
(
LPDIRECTSOUND8
iface
);
static
HRESULT
DirectSoundDevice_Create
(
DirectSoundDevice
**
ppDevice
);
static
ULONG
DirectSoundDevice_AddRef
(
DirectSoundDevice
*
device
);
static
ULONG
DirectSoundDevice_Release
(
DirectSoundDevice
*
device
);
static
const
char
*
dumpCooperativeLevel
(
DWORD
level
)
...
...
@@ -691,7 +692,7 @@ static HRESULT WINAPI IDirectSoundImpl_Initialize(
if
(
DSOUND_renderer
[
wod
])
{
if
(
IsEqualGUID
(
&
devGUID
,
&
DSOUND_renderer
[
wod
]
->
guid
))
{
device
=
DSOUND_renderer
[
wod
];
device
->
ref
++
;
DirectSoundDevice_AddRef
(
device
)
;
This
->
device
=
device
;
return
DS_OK
;
}
else
{
...
...
@@ -940,14 +941,20 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice)
return
DS_OK
;
}
static
ULONG
DirectSoundDevice_AddRef
(
DirectSoundDevice
*
device
)
{
ULONG
ref
=
InterlockedIncrement
(
&
(
device
->
ref
));
TRACE
(
"(%p) ref was %ld
\n
"
,
device
,
ref
-
1
);
return
ref
;
}
static
ULONG
DirectSoundDevice_Release
(
DirectSoundDevice
*
device
)
{
int
i
;
HRESULT
hr
;
TRACE
(
"(%p) ref was %lu
\n
"
,
device
,
device
->
ref
);
device
->
ref
--
;
if
(
device
->
ref
==
0
)
{
ULONG
ref
=
InterlockedDecrement
(
&
(
device
->
ref
)
);
TRACE
(
"(%p) ref was %lu
\n
"
,
device
,
ref
+
1
);
if
(
!
ref
)
{
int
i
;
timeKillEvent
(
device
->
timerID
);
timeEndPeriod
(
DS_TIME_RES
);
/* wait for timer to expire */
...
...
@@ -994,7 +1001,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
HeapFree
(
GetProcessHeap
(),
0
,
device
);
TRACE
(
"(%p) released
\n
"
,
device
);
}
return
device
->
ref
;
return
ref
;
}
HRESULT
WINAPI
IDirectSoundImpl_Create
(
...
...
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