Commit 60139882 authored by Pavel Vainerman's avatar Pavel Vainerman

(Configuration): подправил работу с shared_ptr

parent 1d72749d
...@@ -175,8 +175,8 @@ namespace UniSetTypes ...@@ -175,8 +175,8 @@ namespace UniSetTypes
if( fileConf.empty() ) if( fileConf.empty() )
setConfFileName(); setConfFileName();
ObjectIndex_Array* _oi = new ObjectIndex_Array(omap); shared_ptr<ObjectIndex_Array> _oi = make_shared<ObjectIndex_Array>(omap);
oind = shared_ptr<ObjectIndex>(_oi); oind = static_pointer_cast<ObjectIndex>(_oi);
initConfiguration(argc, argv); initConfiguration(argc, argv);
} }
...@@ -212,7 +212,7 @@ namespace UniSetTypes ...@@ -212,7 +212,7 @@ namespace UniSetTypes
try try
{ {
if( unixml == nullptr ) if( !unixml )
unixml = make_shared<UniXML>(); unixml = make_shared<UniXML>();
if( !unixml->isOpen() ) if( !unixml->isOpen() )
...@@ -247,13 +247,13 @@ namespace UniSetTypes ...@@ -247,13 +247,13 @@ namespace UniSetTypes
{ {
if( it.getIntProp("idfromfile") == 0 ) if( it.getIntProp("idfromfile") == 0 )
{ {
ObjectIndex_XML* oi = new ObjectIndex_XML(unixml); //(fileConfName); shared_ptr<ObjectIndex_XML> oi = make_shared<ObjectIndex_XML>(unixml); //(fileConfName);
oind = shared_ptr<ObjectIndex>(oi); oind = static_pointer_cast<ObjectIndex>(oi);
} }
else else
{ {
ObjectIndex_idXML* oi = new ObjectIndex_idXML(unixml); //(fileConfName); shared_ptr<ObjectIndex_idXML> oi = make_shared<ObjectIndex_idXML>(unixml); //(fileConfName);
oind = shared_ptr<ObjectIndex>(oi); oind = static_pointer_cast<ObjectIndex>(oi);
} }
} }
catch( const Exception& ex ) catch( const Exception& ex )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment