diff --git a/alpm/manager.cpp b/alpm/manager.cpp index f758bfe..dd846a6 100644 --- a/alpm/manager.cpp +++ b/alpm/manager.cpp @@ -483,15 +483,15 @@ void Manager::initAlpmDataBases() if(localDatabase()) { QObject::connect(localDatabase(), &AlpmDatabase::initialized, bind(&Manager::computeRequiredBy, this, localDatabase())); } - for(auto &syncDbEntry : m_syncDbMap) { - QObject::connect(syncDbEntry.second, &AlpmDatabase::initialized, bind(&Manager::computeRequiredBy, this, syncDbEntry.second)); + for(auto &syncDb : m_syncDbs) { + QObject::connect(syncDb.get(), &AlpmDatabase::initialized, bind(&Manager::computeRequiredBy, this, syncDb.get())); } } else { if(localDatabase()) { QObject::connect(localDatabase(), &AlpmDatabase::initialized, this, &Manager::emitUpdatesAvailable); } - for(auto &syncDbEntry : m_syncDbMap) { - QObject::connect(syncDbEntry.second, &AlpmDatabase::initialized, this, &Manager::emitUpdatesAvailable); + for(auto &syncDb : m_syncDbs) { + QObject::connect(syncDb.get(), &AlpmDatabase::initialized, this, &Manager::emitUpdatesAvailable); } } @@ -527,7 +527,7 @@ void Manager::initAlpmDataBases() cerr << endl << shchar << "Unable to initialize ALPM database [" << loader->database()->name().toLocal8Bit().data() << "]" << endl; // TODO: print the cause of the problem } - delete loader; + //delete loader; the repo has ownership } } if(m_config.isVerbose() || m_config.runServer()) {