From a26bf261a908f8c76196d702cd61accf894b52f2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 27 May 2021 14:03:46 +0200 Subject: [PATCH] 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. --- src/input/LastInputStream.hxx | 3 +-- 1 file changed, 1 insertion(+), 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(new_uri);