[DEBUG] correct segfault

This commit is contained in:
Edouard DUPIN 2015-03-20 21:45:30 +01:00
parent ae0aa6aa6c
commit 4c3fe665cf

View File

@ -19,7 +19,9 @@ void river::init(const std::string& _filename) {
river_configFile = _filename; river_configFile = _filename;
RIVER_DEBUG("init RIVER :" << river_configFile); RIVER_DEBUG("init RIVER :" << river_configFile);
std11::shared_ptr<river::io::Manager> mng = river::io::Manager::getInstance(); std11::shared_ptr<river::io::Manager> mng = river::io::Manager::getInstance();
mng->init(river_configFile); if (mng != nullptr) {
mng->init(river_configFile);
}
} else { } else {
RIVER_ERROR("River is already init not use : " << _filename); RIVER_ERROR("River is already init not use : " << _filename);
} }
@ -31,7 +33,9 @@ void river::initString(const std::string& _config) {
river_configFile = _config; river_configFile = _config;
RIVER_DEBUG("init RIVER with config."); RIVER_DEBUG("init RIVER with config.");
std11::shared_ptr<river::io::Manager> mng = river::io::Manager::getInstance(); std11::shared_ptr<river::io::Manager> mng = river::io::Manager::getInstance();
mng->initString(river_configFile); if (mng != nullptr) {
mng->initString(river_configFile);
}
} else { } else {
RIVER_ERROR("River is already init not use Data ..."); RIVER_ERROR("River is already init not use Data ...");
} }
@ -42,7 +46,10 @@ void river::unInit() {
river_isInit = false; river_isInit = false;
RIVER_DEBUG("un-init RIVER."); RIVER_DEBUG("un-init RIVER.");
std11::shared_ptr<river::io::Manager> mng = river::io::Manager::getInstance(); std11::shared_ptr<river::io::Manager> mng = river::io::Manager::getInstance();
mng->unInit(); if (mng != nullptr) {
RIVER_ERROR("Can not get on the RIVER hardware manager !!!");
mng->unInit();
}
} }
} }