diff --git a/lib/shared_memory.cpp b/lib/shared_memory.cpp index 73c2d667..7b66edc6 100644 --- a/lib/shared_memory.cpp +++ b/lib/shared_memory.cpp @@ -293,7 +293,7 @@ namespace IPC { #ifdef __CYGWIN__ if (master) { //Under cygwin, all pages are 4 bytes longer than claimed. - handle = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, len+4, name.c_str()); + handle = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, len+4, std::string("Global\\" + name).c_str()); } else { int i = 0; do { diff --git a/src/controller/controller_connectors.cpp b/src/controller/controller_connectors.cpp index a1e8faa9..80b59c4c 100644 --- a/src/controller/controller_connectors.cpp +++ b/src/controller/controller_connectors.cpp @@ -149,8 +149,12 @@ namespace Controller { std::map::iterator it; for (it = currentConnectors.begin(); it != currentConnectors.end(); it++){ if (!runningConns.count(it->first)){ - Log("CONF", "Stopping connector " + it->first); - Util::Procs::Stop(it->second); + if (Util::Procs::isActive(it->second)){ + Log("CONF", "Stopping connector " + it->first); + Util::Procs::Stop(it->second); + } + currentConnectors.erase(it); + it = currentConnectors.begin(); } }