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
9fb8469b
Commit
9fb8469b
authored
Nov 10, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Avoid leaking performance channel block ports.
parent
467f3a2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
performance.c
dlls/dmime/performance.c
+17
-4
No files found.
dlls/dmime/performance.c
View file @
9fb8469b
...
...
@@ -245,8 +245,16 @@ static int channel_block_compare(const void *key, const struct wine_rb_entry *en
static
void
channel_block_free
(
struct
wine_rb_entry
*
entry
,
void
*
context
)
{
struct
channel_block
*
b
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
channel_block
,
entry
);
free
(
b
);
struct
channel_block
*
block
=
WINE_RB_ENTRY_VALUE
(
entry
,
struct
channel_block
,
entry
);
UINT
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
block
->
channels
);
i
++
)
{
struct
channel
*
channel
=
block
->
channels
+
i
;
if
(
channel
->
port
)
IDirectMusicPort_Release
(
channel
->
port
);
}
free
(
block
);
}
static
struct
channel
*
performance_get_channel
(
struct
performance
*
This
,
DWORD
channel_num
)
...
...
@@ -278,7 +286,8 @@ static HRESULT channel_block_init(struct performance *This, DWORD block_num,
struct
channel
*
channel
=
block
->
channels
+
i
;
channel
->
midi_group
=
midi_group
;
channel
->
midi_channel
=
i
;
channel
->
port
=
port
;
if
(
channel
->
port
)
IDirectMusicPort_Release
(
channel
->
port
);
if
((
channel
->
port
=
port
))
IDirectMusicPort_AddRef
(
channel
->
port
);
}
return
S_OK
;
...
...
@@ -992,6 +1001,8 @@ static HRESULT perf_dmport_create(struct performance *perf, DMUS_PORTPARAMS *par
return
hr
;
}
wine_rb_destroy
(
&
perf
->
channel_blocks
,
channel_block_free
,
NULL
);
for
(
i
=
0
;
i
<
params
->
dwChannelGroups
;
i
++
)
{
if
(
FAILED
(
hr
=
channel_block_init
(
perf
,
i
,
port
,
i
+
1
)))
...
...
@@ -999,6 +1010,7 @@ static HRESULT perf_dmport_create(struct performance *perf, DMUS_PORTPARAMS *par
}
performance_update_latency_time
(
perf
,
port
,
NULL
);
IDirectMusicPort_Release
(
port
);
return
S_OK
;
}
...
...
@@ -1079,7 +1091,8 @@ static HRESULT WINAPI performance_AssignPChannel(IDirectMusicPerformance8 *iface
channel
->
midi_group
=
midi_group
;
channel
->
midi_channel
=
midi_channel
;
channel
->
port
=
port
;
if
(
channel
->
port
)
IDirectMusicPort_Release
(
channel
->
port
);
if
((
channel
->
port
=
port
))
IDirectMusicPort_AddRef
(
channel
->
port
);
return
S_OK
;
}
...
...
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