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
f900ab01
Commit
f900ab01
authored
Jan 21, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config/Data: add method Clear()
Move code from config_global_finish().
parent
f80ab6a7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
4 deletions
+34
-4
Makefile.am
Makefile.am
+1
-1
ConfigGlobal.cxx
src/config/ConfigGlobal.cxx
+1
-3
Data.cxx
src/config/Data.cxx
+30
-0
Data.hxx
src/config/Data.hxx
+2
-0
No files found.
Makefile.am
View file @
f900ab01
...
...
@@ -769,7 +769,7 @@ endif
libconf_a_SOURCES
=
\
src/config/ConfigDefaults.hxx
\
src/config/ConfigPath.cxx src/config/ConfigPath.hxx
\
src/config/Data.hxx
\
src/config/Data.
cxx src/config/Data.
hxx
\
src/config/Block.cxx src/config/Block.hxx
\
src/config/Param.cxx src/config/Param.hxx
\
src/config/ConfigParser.cxx src/config/ConfigParser.hxx
\
...
...
src/config/ConfigGlobal.cxx
View file @
f900ab01
...
...
@@ -37,9 +37,7 @@ static ConfigData config_data;
void
config_global_finish
(
void
)
{
for
(
auto
i
:
config_data
.
params
)
delete
i
;
config_data
.
params
.
fill
(
0
);
config_data
.
Clear
();
}
void
config_global_init
(
void
)
...
...
src/config/Data.cxx
0 → 100644
View file @
f900ab01
/*
* Copyright (C) 2003-2015 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "Data.hxx"
#include "Param.hxx"
void
ConfigData
::
Clear
()
{
for
(
auto
i
:
params
)
delete
i
;
params
.
fill
(
nullptr
);
}
src/config/Data.hxx
View file @
f900ab01
...
...
@@ -28,6 +28,8 @@ struct config_param;
struct
ConfigData
{
std
::
array
<
config_param
*
,
std
::
size_t
(
CONF_MAX
)
>
params
;
void
Clear
();
};
#endif
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