erase node before deleting module?
This commit is contained in:
@@ -78,12 +78,15 @@ void App::load(std::string lib) {
|
|||||||
void App::unload(decltype(Module::self) it) {
|
void App::unload(decltype(Module::self) it) {
|
||||||
void* handle = (*it)->getHandle();
|
void* handle = (*it)->getHandle();
|
||||||
std::cout << "retrieved handle\nAttempting to delete module: " << (*it)->getName() << std::endl;
|
std::cout << "retrieved handle\nAttempting to delete module: " << (*it)->getName() << std::endl;
|
||||||
delete *it;
|
Module* m = *it;
|
||||||
|
*it = nullptr;
|
||||||
|
modules.erase(it);
|
||||||
|
std::cout << "erased iterator\n";
|
||||||
|
delete m;
|
||||||
std::cout << "deleted module\n";
|
std::cout << "deleted module\n";
|
||||||
dlclose(handle);
|
dlclose(handle);
|
||||||
std::cout << "closed handle\n";
|
std::cout << "closed handle\n";
|
||||||
modules.erase(it);
|
|
||||||
std::cout << "erased iterator\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::handleArgs(const int& argc, char* argv[]) {
|
void App::handleArgs(const int& argc, char* argv[]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user