Commit 6a78d111 authored by Max Kellermann's avatar Max Kellermann

decoder/gme: use AtScopeExit()

parent 256ee7a8
......@@ -25,6 +25,7 @@
#include "tag/TagHandler.hxx"
#include "fs/Path.hxx"
#include "fs/AllocatedPath.hxx"
#include "util/ScopeExit.hxx"
#include "util/FormatString.hxx"
#include "util/AllocatedString.hxx"
#include "util/UriUtil.hxx"
......@@ -141,6 +142,8 @@ gme_file_decode(Decoder &decoder, Path path_fs)
return;
}
AtScopeExit(emu) { gme_delete(emu); };
FormatDebug(gme_domain, "emulator type '%s'\n",
gme_type_system(gme_type(emu)));
......@@ -153,7 +156,6 @@ gme_file_decode(Decoder &decoder, Path path_fs)
gme_err = gme_track_info(emu, &ti, container.track);
if (gme_err != nullptr) {
LogWarning(gme_domain, gme_err);
gme_delete(emu);
return;
}
......@@ -172,7 +174,6 @@ gme_file_decode(Decoder &decoder, Path path_fs)
SampleFormat::S16, GME_CHANNELS,
error)) {
LogError(error);
gme_delete(emu);
return;
}
......@@ -209,8 +210,6 @@ gme_file_decode(Decoder &decoder, Path path_fs)
if (gme_track_ended(emu))
break;
} while (cmd != DecoderCommand::STOP);
gme_delete(emu);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment