Changeset 2228
- Timestamp:
- 08/08/2008 22:50:28 (2 years ago)
- Files:
-
- 1 modified
-
box/trunk/lib/common/Configuration.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/common/Configuration.cpp
r2155 r2228 200 200 201 201 // Object to create 202 Configuration *pconfig = new Configuration(std::string("<root>")); 202 std::auto_ptr<Configuration> apConfig( 203 new Configuration(std::string("<root>"))); 203 204 204 205 try 205 206 { 206 207 // Load 207 LoadInto(* pconfig, getline, rErrorMsg, true);208 LoadInto(*apConfig, getline, rErrorMsg, true); 208 209 209 210 if(!rErrorMsg.empty()) … … 212 213 BOX_ERROR("Error in Configuration::LoadInto: " << 213 214 rErrorMsg); 214 delete pconfig;215 pconfig = 0;216 215 return std::auto_ptr<Configuration>(0); 217 216 } … … 220 219 if(pVerify) 221 220 { 222 if(!Verify(*pconfig, *pVerify, std::string(), rErrorMsg)) 221 if(!Verify(*apConfig, *pVerify, std::string(), 222 rErrorMsg)) 223 223 { 224 224 BOX_ERROR("Error verifying configuration: " << 225 225 rErrorMsg); 226 delete pconfig;227 pconfig = 0;228 226 return std::auto_ptr<Configuration>(0); 229 227 } … … 233 231 { 234 232 // Clean up 235 delete pconfig;236 pconfig = 0;237 233 throw; 238 234 } 239 235 240 236 // Success. Return result. 241 return std::auto_ptr<Configuration>(pconfig);237 return apConfig; 242 238 } 243 239
