Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tools/projmgr/include/ProjMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ class ProjMgr {
*/
ProjMgrWorker& GetWorker() { return m_worker; };

/**
* @brief clear internal structures and worker object
*/
void Clear();

/**
* @brief load solution
* @param path to <solution>.csolution.yml file
Expand Down
5 changes: 2 additions & 3 deletions tools/projmgr/include/ProjMgrWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ struct ValidationResult {
std::vector<ValidationCondition> conditions;
};

/**
/**
* @brief gdb server item containing
* port number of processor
* processor name
Expand Down Expand Up @@ -922,7 +922,7 @@ class ProjMgrWorker {
}
m_contexts.clear();
m_ymlOrderedContexts.clear();
m_contextsPtr->clear();
m_contexts.clear();
m_contextErrMap.clear();
m_selectedContexts.clear();
m_outputDir.clear();
Expand Down Expand Up @@ -951,7 +951,6 @@ class ProjMgrWorker {
std::map<std::string, StrMap> m_regToolchainsEnvVars;
std::vector<std::string> m_ymlOrderedContexts;
std::map<std::string, ContextItem> m_contexts;
std::map<std::string, ContextItem>* m_contextsPtr;
std::map<std::string, std::set<std::string>> m_contextErrMap;
std::vector<std::string> m_selectedContexts;
std::string m_outputDir;
Expand Down
16 changes: 9 additions & 7 deletions tools/projmgr/src/ProjMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,14 +1170,16 @@ const string ProjMgr::GetToolboxVersion(const string& toolboxDir) {
return matchResult[1].str();
}

void ProjMgr::Clear() {
m_parser.Clear();
m_extGenerator.Clear();
m_worker.Clear();
m_runDebug.Clear();
ProjMgrLogger::Get().Clear();
}

bool ProjMgr::LoadSolution(const std::string& csolution) {
if (!m_csolutionFile.empty()) {
m_parser.Clear();
m_extGenerator.Clear();
m_worker.Clear();
m_runDebug.Clear();
ProjMgrLogger::Get().Clear();
}
Clear();

m_csolutionFile = csolution;
m_rootDir = RteUtils::ExtractFilePath(m_csolutionFile, false);
Expand Down
9 changes: 6 additions & 3 deletions tools/projmgr/src/ProjMgrRpcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,13 @@ RpcArgs::UsedItems RpcHandler::GetUsedItems(const string& context) {
}

bool RpcHandler::LoadPacks(void) {
m_manager.Clear();
m_solutionLoaded = false;
m_worker.InitializeModel();
m_worker.SetLoadPacksPolicy(LoadPacksPolicy::ALL);
m_packsLoaded = m_worker.LoadPacks(m_globalContext);
m_packsLoaded = m_worker.LoadAllRelevantPacks();
m_worker.SetLoadPacksPolicy(LoadPacksPolicy::DEFAULT);
if (!m_packsLoaded) {
if(!m_packsLoaded) {
throw JsonRpcException(PACKS_LOADING_FAIL, "packs failed to load");
}
return true;
Expand Down Expand Up @@ -256,7 +259,7 @@ RpcArgs::PacksInfo RpcHandler::GetPacksInfo(const string& context) {
}

RpcArgs::PacksInfo packsInfo;
for (auto& [pack, packItem] : m_globalContext.rteActiveTarget->GetFilteredModel()->GetPackages()) {
for (auto& [pack, packItem] : contextItem.rteActiveTarget->GetFilteredModel()->GetPackages()) {
RpcArgs::Pack p;
p.id = packItem->GetPackageID(true);
const auto& description = packItem->GetDescription();
Expand Down
3 changes: 1 addition & 2 deletions tools/projmgr/src/ProjMgrWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,7 @@
}

void ProjMgrWorker::GetContexts(map<string, ContextItem>* &contexts) {
m_contextsPtr = &m_contexts;
contexts = m_contextsPtr;
contexts = &m_contexts;
Comment thread Dismissed
}

void ProjMgrWorker::GetYmlOrderedContexts(vector<string> &contexts) {
Expand Down
Loading