diff --git a/src/input/Manager.cc b/src/input/Manager.cc index 8eaca07e78..6d97c2f50b 100644 --- a/src/input/Manager.cc +++ b/src/input/Manager.cc @@ -33,6 +33,7 @@ class Manager::Filter { public: string name; string source; + bool removed; int mode; @@ -51,6 +52,7 @@ Manager::Filter::Filter() { type = 0; reader = 0; description = 0; + removed = false; } Manager::Filter::~Filter() { @@ -597,6 +599,13 @@ bool Manager::RemoveStream(const string &name) { return false; // not found } + if ( i->removed ) { + reporter->Error("Stream %s is already queued for removal. Ignoring", name.c_str()); + return false; + } + + i->removed = true; + i->reader->Finish(); #ifdef DEBUG