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
5c6fe97b
Commit
5c6fe97b
authored
Jan 08, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/pls: simplify error handler
Don't pass a GError** to g_key_file_get_X(). We don't need to dispose something we didn't request in the first place.
parent
2071070f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
PlsPlaylistPlugin.cxx
src/playlist/PlsPlaylistPlugin.cxx
+4
-11
No files found.
src/playlist/PlsPlaylistPlugin.cxx
View file @
5c6fe97b
...
...
@@ -81,25 +81,18 @@ pls_parser(GKeyFile *keyfile, std::forward_list<SongPointer> &songs)
sprintf
(
key
,
"Title%u"
,
num_entries
);
value
=
g_key_file_get_string
(
keyfile
,
"playlist"
,
key
,
&
erro
r
);
if
(
error
==
nullptr
&&
value
!=
nullptr
)
nullpt
r
);
if
(
value
!=
nullptr
)
tag
.
AddItem
(
TAG_TITLE
,
value
);
/* Ignore errors? Most likely value not present */
if
(
error
)
g_error_free
(
error
);
error
=
nullptr
;
g_free
(
value
);
sprintf
(
key
,
"Length%u"
,
num_entries
);
length
=
g_key_file_get_integer
(
keyfile
,
"playlist"
,
key
,
&
erro
r
);
if
(
error
==
nullptr
&&
length
>
0
)
nullpt
r
);
if
(
length
>
0
)
tag
.
SetTime
(
length
);
/* Ignore errors? Most likely value not present */
if
(
error
)
g_error_free
(
error
);
error
=
nullptr
;
song
->
tag
=
tag
.
CommitNew
();
songs
.
emplace_front
(
song
);
num_entries
--
;
...
...
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