Skip to content
Snippets Groups Projects
Commit bcece9ec authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Assert replaced with throw since to avoid "unused variable" warnings in...

Assert replaced with throw since to avoid "unused variable" warnings in release mode. Also conceptually it should be throw.
parent d4ee259a
No related branches found
No related tags found
No related merge requests found
...@@ -43,12 +43,18 @@ ProjectManager *AppSvc::this_projectManager() ...@@ -43,12 +43,18 @@ ProjectManager *AppSvc::this_projectManager()
void AppSvc::this_subscribe(ProjectManager *projectManager) void AppSvc::this_subscribe(ProjectManager *projectManager)
{ {
Q_ASSERT(m_projectManager == nullptr); if(m_projectManager != nullptr) {
throw GUIHelpers::Error("AppSvc::projectManager() -> Error. Attempt to subscribe "
"ProjectManager twice.");
}
m_projectManager = projectManager; m_projectManager = projectManager;
} }
void AppSvc::this_unsubscribe(ProjectManager *projectManager) void AppSvc::this_unsubscribe(ProjectManager *projectManager)
{ {
Q_ASSERT(m_projectManager == projectManager); if(m_projectManager != projectManager) {
throw GUIHelpers::Error("AppSvc::projectManager() -> Error. Attempt to unsubscribe "
"ProjectManager before it was subscribed.");
}
m_projectManager = nullptr; m_projectManager = nullptr;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment