Skip to content

Commit

Permalink
Refs #5230: if no threads are available, log instead of big scary dlg
Browse files Browse the repository at this point in the history
  • Loading branch information
Janik Zikovsky committed May 4, 2012
1 parent 0913797 commit 11be3c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Code/Mantid/MantidPlot/src/Mantid/MantidUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ m_finishedLoadDAEObserver(*this, &MantidUI::handleLoadDAEFinishedNotification),
m_renameObserver(*this,&MantidUI::handleRenameWorkspace),
m_groupworkspacesObserver(*this,&MantidUI::handleGroupWorkspaces),
m_ungroupworkspaceObserver(*this,&MantidUI::handleUnGroupWorkspace),
m_appWindow(aw), m_vatesSubWindow(NULL)
m_appWindow(aw), m_vatesSubWindow(NULL),
g_log(Mantid::Kernel::Logger::get("MantidUI"))
{
// To be able to use them in queued signals they need to be registered
static bool registered_addtional_types = false;
Expand Down Expand Up @@ -1617,7 +1618,15 @@ bool MantidUI::executeAlgorithmAsync(Mantid::API::IAlgorithm_sptr alg, const boo
}
else
{
alg->executeAsync();
try
{
alg->executeAsync();
}
catch (Poco::NoThreadAvailableException & e)
{
g_log.error() << "No thread was available to run the " << alg->name() << " algorithm in the background." << std::endl;
return false;
}
return true;
}
}
Expand Down
3 changes: 3 additions & 0 deletions Code/Mantid/MantidPlot/src/Mantid/MantidUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ public slots:

QMdiSubWindow *m_vatesSubWindow; ///< Holder for the Vates interface sub-window

/// Logger object
Mantid::Kernel::Logger & g_log;

};


Expand Down

0 comments on commit 11be3c5

Please sign in to comment.