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
2a1fd985
Commit
2a1fd985
authored
Sep 22, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Avoid leaking articulations when freeing regions.
parent
8e881787
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
instrument.c
dlls/dmusic/instrument.c
+15
-9
No files found.
dlls/dmusic/instrument.c
View file @
2a1fd985
...
...
@@ -44,6 +44,19 @@ struct region
BOOL
loop_present
;
};
static
void
region_destroy
(
struct
region
*
region
)
{
struct
articulation
*
articulation
,
*
next
;
LIST_FOR_EACH_ENTRY_SAFE
(
articulation
,
next
,
&
region
->
articulations
,
struct
articulation
,
entry
)
{
list_remove
(
&
articulation
->
entry
);
free
(
articulation
);
}
free
(
region
);
}
struct
instrument
{
IDirectMusicInstrument
IDirectMusicInstrument_iface
;
...
...
@@ -122,15 +135,8 @@ static ULONG WINAPI instrument_Release(LPDIRECTMUSICINSTRUMENT iface)
LIST_FOR_EACH_ENTRY_SAFE
(
region
,
next_region
,
&
This
->
regions
,
struct
region
,
entry
)
{
LIST_FOR_EACH_ENTRY_SAFE
(
articulation
,
next_articulation
,
&
region
->
articulations
,
struct
articulation
,
entry
)
{
list_remove
(
&
articulation
->
entry
);
free
(
articulation
);
}
list_remove
(
&
region
->
entry
);
free
(
region
);
region_destroy
(
region
);
}
collection_internal_release
(
This
->
collection
);
...
...
@@ -322,7 +328,7 @@ static HRESULT parse_rgn_chunk(struct instrument *This, IStream *stream, struct
if
(
FAILED
(
hr
))
break
;
}
if
(
FAILED
(
hr
))
free
(
region
);
if
(
FAILED
(
hr
))
region_destroy
(
region
);
else
list_add_tail
(
&
This
->
regions
,
&
region
->
entry
);
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