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
68860637
Commit
68860637
authored
Jan 04, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MusicPipe: allocate with new/delete
parent
c04e1ad4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
MusicPipe.cxx
src/MusicPipe.cxx
+18
-17
No files found.
src/MusicPipe.cxx
View file @
68860637
...
...
@@ -42,33 +42,34 @@ struct music_pipe {
#ifndef NDEBUG
struct
audio_format
audio_format
;
#endif
music_pipe
()
:
head
(
nullptr
),
tail_r
(
&
head
),
size
(
0
),
mutex
(
g_mutex_new
())
{
#ifndef NDEBUG
audio_format_clear
(
&
audio_format
);
#endif
}
~
music_pipe
()
{
assert
(
head
==
nullptr
);
assert
(
tail_r
==
&
head
);
g_mutex_free
(
mutex
);
}
};
struct
music_pipe
*
music_pipe_new
(
void
)
{
struct
music_pipe
*
mp
=
g_new
(
struct
music_pipe
,
1
);
mp
->
head
=
NULL
;
mp
->
tail_r
=
&
mp
->
head
;
mp
->
size
=
0
;
mp
->
mutex
=
g_mutex_new
();
#ifndef NDEBUG
audio_format_clear
(
&
mp
->
audio_format
);
#endif
return
mp
;
return
new
music_pipe
();
}
void
music_pipe_free
(
struct
music_pipe
*
mp
)
{
assert
(
mp
->
head
==
NULL
);
assert
(
mp
->
tail_r
==
&
mp
->
head
);
g_mutex_free
(
mp
->
mutex
);
g_free
(
mp
);
delete
mp
;
}
#ifndef NDEBUG
...
...
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