diff options
author | Max Kellermann <max@duempel.org> | 2016-02-21 08:03:32 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-02-21 08:03:32 +0100 |
commit | cadc67ea40d761281d768256514d6660d820500f (patch) | |
tree | a94b048981d852aa9f1141103554eba4c5e601fb /test/run_input.cxx | |
parent | 054e9ecaaebe6a8536c894c5093bdce99577e51f (diff) |
input: wrap InputStream in std::unique_ptr
Diffstat (limited to 'test/run_input.cxx')
-rw-r--r-- | test/run_input.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/run_input.cxx b/test/run_input.cxx index 6d51b3749..b93f71548 100644 --- a/test/run_input.cxx +++ b/test/run_input.cxx @@ -118,20 +118,20 @@ int main(int argc, char **argv) /* open the stream and dump it */ - Mutex mutex; - Cond cond; - - InputStream *is = InputStream::OpenReady(argv[1], mutex, cond, error); int ret; - if (is != NULL) { - ret = dump_input_stream(is); - delete is; - } else { - if (error.IsDefined()) - LogError(error); - else - fprintf(stderr, "input_stream::Open() failed\n"); - ret = EXIT_FAILURE; + { + Mutex mutex; + Cond cond; + auto is = InputStream::OpenReady(argv[1], mutex, cond, error); + if (is) { + ret = dump_input_stream(is.get()); + } else { + if (error.IsDefined()) + LogError(error); + else + fprintf(stderr, "input_stream::Open() failed\n"); + ret = EXIT_FAILURE; + } } /* deinitialize everything */ |