Bugfixes part 3 #209

Open
andrey wants to merge 36 commits from bugfixes3 into master
Showing only changes of commit 4f601a9408 - Show all commits
+9 -3
View File
@@ -572,6 +572,8 @@ bool PIConnection::removeFilter(const PIString & name_) {
void PIConnection::removeAllFilters() { void PIConnection::removeAllFilters() {
PIVector<Extractor *> to_delete;
PIVector<PIDiagnostics *> diags_to_delete;
__device_pool__->lock(); __device_pool__->lock();
for (auto i = extractors.begin(); i != extractors.end(); i++) { for (auto i = extractors.begin(); i != extractors.end(); i++) {
if (!i.value()) continue; if (!i.value()) continue;
@@ -581,14 +583,18 @@ void PIConnection::removeAllFilters() {
it.value().removeAll(i.value()->extractor); it.value().removeAll(i.value()->extractor);
} }
if (diags_.value(i.value()->extractor)) { if (diags_.value(i.value()->extractor)) {
delete diags_.value(i.value()->extractor); diags_to_delete << diags_.value(i.value()->extractor);
}
diags_.remove(i.value()->extractor); diags_.remove(i.value()->extractor);
delete i.value(); }
to_delete << i.value();
} }
extractors.clear(); extractors.clear();
bounded_extractors.clear(); bounded_extractors.clear();
__device_pool__->unlock(); __device_pool__->unlock();
for (auto e: to_delete)
delete e;
for (auto d: diags_to_delete)
delete d;
} }