prevent several remove operations for the same thread to be queued and output errors in that case.

This commit is contained in:
Bernhard Amann 2012-03-23 12:30:54 -07:00
parent 315948dbc8
commit 872ad195f7

View file

@ -33,6 +33,7 @@ class Manager::Filter {
public: public:
string name; string name;
string source; string source;
bool removed;
int mode; int mode;
@ -51,6 +52,7 @@ Manager::Filter::Filter() {
type = 0; type = 0;
reader = 0; reader = 0;
description = 0; description = 0;
removed = false;
} }
Manager::Filter::~Filter() { Manager::Filter::~Filter() {
@ -597,6 +599,13 @@ bool Manager::RemoveStream(const string &name) {
return false; // not found 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(); i->reader->Finish();
#ifdef DEBUG #ifdef DEBUG