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
c5133f60
Commit
c5133f60
authored
Nov 22, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/update/Container: catch C++ exceptions
parent
27d368d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
26 deletions
+38
-26
Container.cxx
src/db/update/Container.cxx
+36
-24
GmeDecoderPlugin.cxx
src/decoder/plugins/GmeDecoderPlugin.cxx
+2
-2
No files found.
src/db/update/Container.cxx
View file @
c5133f60
...
@@ -96,38 +96,50 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
...
@@ -96,38 +96,50 @@ UpdateWalk::UpdateContainerFile(Directory &directory,
return
false
;
return
false
;
}
}
const
auto
v
=
plugin
.
container_scan
(
pathname
);
try
{
if
(
v
.
empty
())
{
const
auto
v
=
plugin
.
container_scan
(
pathname
);
editor
.
LockDeleteDirectory
(
contdir
);
if
(
v
.
empty
())
{
return
false
;
editor
.
LockDeleteDirectory
(
contdir
);
}
return
false
;
}
TagBuilder
tag_builder
;
TagBuilder
tag_builder
;
for
(
const
auto
&
vtrack
:
v
)
{
for
(
const
auto
&
vtrack
:
v
)
{
Song
*
song
=
Song
::
NewFile
(
vtrack
.
c_str
(),
*
contdir
);
Song
*
song
=
Song
::
NewFile
(
vtrack
.
c_str
(),
*
contdir
);
// shouldn't be necessary but it's there..
// shouldn't be necessary but it's there..
song
->
mtime
=
info
.
mtime
;
song
->
mtime
=
info
.
mtime
;
const
auto
vtrack_fs
=
AllocatedPath
::
FromUTF8
(
vtrack
.
c_str
());
try
{
// TODO: check vtrack_fs.IsNull()
const
auto
vtrack_fs
=
AllocatedPath
::
FromUTF8Throw
(
vtrack
.
c_str
());
const
auto
child_path_fs
=
AllocatedPath
::
Build
(
pathname
,
const
auto
child_path_fs
=
AllocatedPath
::
Build
(
pathname
,
vtrack_fs
);
vtrack_fs
);
plugin
.
ScanFile
(
child_path_fs
,
plugin
.
ScanFile
(
child_path_fs
,
add_tag_handler
,
&
tag_builder
);
add_tag_handler
,
&
tag_builder
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
song
->
Free
();
LogError
(
e
);
continue
;
}
tag_builder
.
Commit
(
song
->
tag
);
tag_builder
.
Commit
(
song
->
tag
);
{
{
const
ScopeDatabaseLock
protect
;
const
ScopeDatabaseLock
protect
;
contdir
->
AddSong
(
song
);
contdir
->
AddSong
(
song
);
}
}
modified
=
true
;
modified
=
true
;
FormatDefault
(
update_domain
,
"added %s/%s"
,
FormatDefault
(
update_domain
,
"added %s/%s"
,
directory
.
GetPath
(),
vtrack
.
c_str
());
directory
.
GetPath
(),
vtrack
.
c_str
());
}
}
catch
(
const
std
::
runtime_error
&
e
)
{
editor
.
LockDeleteDirectory
(
contdir
);
LogError
(
e
);
return
false
;
}
}
return
true
;
return
true
;
...
...
src/decoder/plugins/GmeDecoderPlugin.cxx
View file @
c5133f60
...
@@ -266,10 +266,10 @@ ScanMusicEmu(Music_Emu *emu, unsigned song_num,
...
@@ -266,10 +266,10 @@ ScanMusicEmu(Music_Emu *emu, unsigned song_num,
assert
(
ti
!=
nullptr
);
assert
(
ti
!=
nullptr
);
AtScopeExit
(
ti
)
{
gme_free_info
(
ti
);
};
ScanGmeInfo
(
*
ti
,
song_num
,
gme_track_count
(
emu
),
ScanGmeInfo
(
*
ti
,
song_num
,
gme_track_count
(
emu
),
handler
,
handler_ctx
);
handler
,
handler_ctx
);
gme_free_info
(
ti
);
return
true
;
return
true
;
}
}
...
...
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