summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2017-10-11 14:48:22 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2017-10-11 14:56:58 +0200
commit9c7d0f544b7a4dec54e9a75ea45b985ad7fac756 (patch)
treee0d704dbc9472723cca97a11ca1d79de8ce9feb5 /src
parent70151c3e497f42fbfd305124ca3e9f858f90c686 (diff)
downloadastra-9c7d0f544b7a4dec54e9a75ea45b985ad7fac756.tar.gz
astra-9c7d0f544b7a4dec54e9a75ea45b985ad7fac756.tar.bz2
astra-9c7d0f544b7a4dec54e9a75ea45b985ad7fac756.tar.xz
astra-9c7d0f544b7a4dec54e9a75ea45b985ad7fac756.zip
Improve object creation error messages
Diffstat (limited to 'src')
-rw-r--r--src/AsyncAlgorithm.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/AsyncAlgorithm.cpp b/src/AsyncAlgorithm.cpp
index 54083a3..a53fb00 100644
--- a/src/AsyncAlgorithm.cpp
+++ b/src/AsyncAlgorithm.cpp
@@ -72,11 +72,13 @@ bool CAsyncAlgorithm::initialize(const Config& _cfg)
m_pAlg = 0;
m_bDone = false;
- m_pAlg = CAlgorithmFactory::getSingleton().create(_cfg);
- if (m_pAlg && !m_pAlg->isInitialized()) {
- if (m_bAutoFree)
- delete m_pAlg;
- m_pAlg = 0;
+ m_pAlg = CAlgorithmFactory::getSingleton().create(_cfg.self.getAttribute("type"));
+ if (m_pAlg) {
+ if (!m_pAlg->initialize(_cfg)) {
+ if (m_bAutoFree)
+ delete m_pAlg;
+ m_pAlg = 0;
+ }
}
m_bInitialized = (m_pAlg != 0);
m_bAutoFree = true;