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
6692f97e
Commit
6692f97e
authored
Aug 16, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Add an object refcount for DirectSoundFullDuplex.
parent
023a19d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
duplex.c
dlls/dsound/duplex.c
+21
-12
No files found.
dlls/dsound/duplex.c
View file @
6692f97e
...
...
@@ -43,8 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound);
typedef
struct
IDirectSoundFullDuplexImpl
{
IDirectSoundFullDuplex
IDirectSoundFullDuplex_iface
;
LONG
ref
;
LONG
ref
,
numIfaces
;
/* IDirectSoundFullDuplexImpl fields */
IDirectSound8
*
renderer_device
;
IDirectSoundCapture
*
capture_device
;
...
...
@@ -72,6 +71,16 @@ typedef struct IDirectSoundFullDuplex_IDirectSoundCapture {
IDirectSoundFullDuplexImpl
*
pdsfd
;
}
IDirectSoundFullDuplex_IDirectSoundCapture
;
static
void
fullduplex_destroy
(
IDirectSoundFullDuplexImpl
*
This
)
{
if
(
This
->
capture_device
)
IDirectSoundCapture_Release
(
This
->
capture_device
);
if
(
This
->
renderer_device
)
IDirectSound_Release
(
This
->
renderer_device
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
/*******************************************************************************
* IUnknown
*/
...
...
@@ -449,7 +458,11 @@ static ULONG WINAPI IDirectSoundFullDuplexImpl_AddRef(IDirectSoundFullDuplex *if
{
IDirectSoundFullDuplexImpl
*
This
=
impl_from_IDirectSoundFullDuplex
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
-
1
);
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
ref
==
1
)
InterlockedIncrement
(
&
This
->
numIfaces
);
return
ref
;
}
...
...
@@ -516,16 +529,11 @@ static ULONG WINAPI IDirectSoundFullDuplexImpl_Release(IDirectSoundFullDuplex *i
{
IDirectSoundFullDuplexImpl
*
This
=
impl_from_IDirectSoundFullDuplex
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
-
1
);
if
(
!
ref
)
{
if
(
This
->
capture_device
)
IDirectSoundCapture_Release
(
This
->
capture_device
);
if
(
This
->
renderer_device
)
IDirectSound_Release
(
This
->
renderer_device
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
TRACE
(
"(%p) ref=%d
\n
"
,
This
,
ref
);
if
(
!
ref
&&
!
InterlockedDecrement
(
&
This
->
numIfaces
))
fullduplex_destroy
(
This
);
return
ref
;
}
...
...
@@ -634,6 +642,7 @@ HRESULT DSOUND_FullDuplexCreate(REFIID riid, void **ppv)
obj
->
IDirectSoundFullDuplex_iface
.
lpVtbl
=
&
dsfd_vtbl
;
obj
->
ref
=
1
;
obj
->
numIfaces
=
1
;
hr
=
IUnknown_QueryInterface
((
IUnknown
*
)
obj
,
riid
,
ppv
);
IUnknown_Release
((
IUnknown
*
)
obj
);
...
...
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