Fixed initialization, no need init logs and network if configuration not ready.
This commit is contained in:
parent
92d787c817
commit
1720d3e096
3 changed files with 12 additions and 5 deletions
|
@ -181,11 +181,14 @@ static char *defaultConfigName()
|
|||
|
||||
Options *Options::parse(int argc, char **argv)
|
||||
{
|
||||
if (!m_self) {
|
||||
m_self = new Options(argc, argv);
|
||||
Options *options = new Options(argc, argv);
|
||||
if (options->isReady()) {
|
||||
m_self = options;
|
||||
return m_self;
|
||||
}
|
||||
|
||||
return m_self;
|
||||
delete options;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue