Fix segfault at exit
This commit is contained in:
parent
6fad32ea98
commit
13b8a0571f
1 changed files with 3 additions and 3 deletions
|
@ -50,8 +50,8 @@ Manager::Manager() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Manager::~Manager() {
|
Manager::~Manager() {
|
||||||
for(Interface* service : m_services) {
|
for(int i = m_services.size() - 1; i >= 0; --i) {
|
||||||
DeleteService(service->GetPortName());
|
DeleteService(m_services[i]->GetPortName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ void Manager::DeleteService(const std::string& port_name) {
|
||||||
Interface* service = FetchFromPortName(port_name);
|
Interface* service = FetchFromPortName(port_name);
|
||||||
m_services.erase(std::remove(m_services.begin(), m_services.end(), service), m_services.end());
|
m_services.erase(std::remove(m_services.begin(), m_services.end(), service), m_services.end());
|
||||||
m_port_map.erase(port_name);
|
m_port_map.erase(port_name);
|
||||||
delete service;
|
Kernel::g_handle_table.Close(service->GetHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get a Service Interface from its Handle
|
/// Get a Service Interface from its Handle
|
||||||
|
|
Loading…
Reference in a new issue