for (list<ControlProtocolInfo*>::iterator p = control_protocol_info.begin(); p != control_protocol_info.end(); ++p) {
+ (*p)->protocol = 0; // protocol was already destroyed above.
delete (*p);
}
ControlProtocolInfo* cpi = cpi_by_name (name);
if (cpi) {
+#ifndef NDEBUG
std::cerr << "protocol " << name << " active ? " << active << std::endl;
+#endif
if (active) {
delete cpi->state;