Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Иван Мажукин
mpd
Commits
e81b0896
Commit
e81b0896
authored
Jun 22, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MusicPipe: automatically clear in destructor
We can implement this now that we have a MusicBuffer reference.
parent
9f14e7a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
23 deletions
+8
-23
MusicPipe.hxx
src/MusicPipe.hxx
+2
-6
MultipleOutputs.cxx
src/output/MultipleOutputs.cxx
+4
-10
Thread.cxx
src/player/Thread.cxx
+2
-7
No files found.
src/MusicPipe.hxx
View file @
e81b0896
...
...
@@ -67,12 +67,8 @@ public:
MusicPipe
(
const
MusicPipe
&
)
=
delete
;
/**
* Frees the object. It must be empty now.
*/
~
MusicPipe
()
{
assert
(
head
==
nullptr
);
assert
(
tail_r
==
&
head
);
~
MusicPipe
()
noexcept
{
Clear
();
}
MusicPipe
&
operator
=
(
const
MusicPipe
&
)
=
delete
;
...
...
src/output/MultipleOutputs.cxx
View file @
e81b0896
...
...
@@ -407,11 +407,8 @@ MultipleOutputs::Close() noexcept
for
(
auto
*
ao
:
outputs
)
ao
->
LockCloseWait
();
if
(
pipe
!=
nullptr
)
{
pipe
->
Clear
();
delete
pipe
;
pipe
=
nullptr
;
}
delete
pipe
;
pipe
=
nullptr
;
input_audio_format
.
Clear
();
...
...
@@ -424,11 +421,8 @@ MultipleOutputs::Release() noexcept
for
(
auto
*
ao
:
outputs
)
ao
->
LockRelease
();
if
(
pipe
!=
nullptr
)
{
pipe
->
Clear
();
delete
pipe
;
pipe
=
nullptr
;
}
delete
pipe
;
pipe
=
nullptr
;
input_audio_format
.
Clear
();
...
...
src/player/Thread.cxx
View file @
e81b0896
...
...
@@ -169,14 +169,9 @@ private:
xfade_state
=
CrossFadeState
::
UNKNOWN
;
}
void
ClearAndDeletePipe
()
noexcept
{
pipe
->
Clear
();
delete
pipe
;
}
void
ClearAndReplacePipe
(
MusicPipe
*
_pipe
)
noexcept
{
ResetCrossFade
();
ClearAndDeletePipe
()
;
delete
pipe
;
pipe
=
_pipe
;
}
...
...
@@ -1070,7 +1065,7 @@ Player::Run() noexcept
CancelPendingSeek
();
StopDecoder
();
ClearAndDeletePipe
()
;
delete
pipe
;
cross_fade_tag
.
reset
();
...
...
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