test/read_tags: use AtScopeExit()

This commit is contained in:
Max Kellermann 2016-12-09 23:49:16 +01:00
parent 30bd190b41
commit 48089394a5

View File

@ -29,6 +29,7 @@
#include "fs/Path.hxx"
#include "thread/Cond.hxx"
#include "Log.hxx"
#include "util/ScopeExit.hxx"
#include <stdexcept>
@ -89,7 +90,10 @@ try {
const ScopeIOThread io_thread;
input_stream_global_init();
AtScopeExit() { input_stream_global_finish(); };
decoder_plugin_init_all();
AtScopeExit() { decoder_plugin_deinit_all(); };
plugin = decoder_plugin_from_name(decoder_name);
if (plugin == NULL) {
@ -107,9 +111,6 @@ try {
success = plugin->ScanStream(*is, print_handler, nullptr);
}
decoder_plugin_deinit_all();
input_stream_global_finish();
if (!success) {
fprintf(stderr, "Failed to read tags\n");
return EXIT_FAILURE;