diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp index 0461e40b9..156e6e120 100644 --- a/modules/database/db_sql_live.cpp +++ b/modules/database/db_sql_live.cpp @@ -191,10 +191,7 @@ class DBMySQL : public Module, public Pipe clear_null = true; std::map::iterator it = obj->objects.find(id); if (it != obj->objects.end()) - { - obj->objects.erase(it); - it->second->Destroy(); // This also tries to remove this object from the map - } + it->second->Destroy(); // This also removes this object from the map } else {