summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-05-27 14:03:46 +0200
committerMax Kellermann <max@musicpd.org>2021-05-27 14:04:28 +0200
commita26bf261a908f8c76196d702cd61accf894b52f2 (patch)
treeae9ddd8cb1836e2389c6174865413f3f7ebc8636
parentc692286c67973fd7500e82f189226516818c4e03 (diff)
input/last: call Close() in Open()
Prevents a possible bug which occurs when the caller-provided open() function throws; then the "uri" field is never set.
-rw-r--r--src/input/LastInputStream.hxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/input/LastInputStream.hxx b/src/input/LastInputStream.hxx
index 635e87741..559d45c16 100644
--- a/src/input/LastInputStream.hxx
+++ b/src/input/LastInputStream.hxx
@@ -64,8 +64,7 @@ public:
return is.get();
}
- is.reset();
- close_timer.Cancel();
+ Close();
is = open(new_uri, mutex);
uri = std::forward<U>(new_uri);