Changeset 295:7c796c1cf1b0 in lemon-main for lemon/lgf_reader.h
- Timestamp:
- 10/05/08 21:09:01 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/lgf_reader.h
r294 r295 518 518 _use_nodes(false), _use_arcs(false), 519 519 _skip_nodes(false), _skip_arcs(false) { 520 if (!(*_is)) throw IoError("Cannot open file", fn); 520 if (!(*_is)) { 521 delete _is; 522 throw IoError("Cannot open file", fn); 523 } 521 524 } 522 525 … … 530 533 _use_nodes(false), _use_arcs(false), 531 534 _skip_nodes(false), _skip_arcs(false) { 532 if (!(*_is)) throw IoError("Cannot open file", fn); 535 if (!(*_is)) { 536 delete _is; 537 throw IoError("Cannot open file", fn); 538 } 533 539 } 534 540 … … 1309 1315 _use_nodes(false), _use_edges(false), 1310 1316 _skip_nodes(false), _skip_edges(false) { 1311 if (!(*_is)) throw IoError("Cannot open file", fn); 1317 if (!(*_is)) { 1318 delete _is; 1319 throw IoError("Cannot open file", fn); 1320 } 1312 1321 } 1313 1322 … … 1321 1330 _use_nodes(false), _use_edges(false), 1322 1331 _skip_nodes(false), _skip_edges(false) { 1323 if (!(*_is)) throw IoError("Cannot open file", fn); 1332 if (!(*_is)) { 1333 delete _is; 1334 throw IoError("Cannot open file", fn); 1335 } 1324 1336 } 1325 1337 … … 2095 2107 : _is(new std::ifstream(fn.c_str())), local_is(true), 2096 2108 _filename(fn) { 2097 if (!(*_is)) throw IoError("Cannot open file", fn); 2109 if (!(*_is)) { 2110 delete _is; 2111 throw IoError("Cannot open file", fn); 2112 } 2098 2113 } 2099 2114 … … 2104 2119 : _is(new std::ifstream(fn)), local_is(true), 2105 2120 _filename(fn) { 2106 if (!(*_is)) throw IoError("Cannot open file", fn); 2121 if (!(*_is)) { 2122 delete _is; 2123 throw IoError("Cannot open file", fn); 2124 } 2107 2125 } 2108 2126 … … 2387 2405 LgfContents(const std::string& fn) 2388 2406 : _is(new std::ifstream(fn.c_str())), local_is(true) { 2389 if (!(*_is)) throw IoError("Cannot open file", fn); 2407 if (!(*_is)) { 2408 delete _is; 2409 throw IoError("Cannot open file", fn); 2410 } 2390 2411 } 2391 2412 … … 2396 2417 LgfContents(const char* fn) 2397 2418 : _is(new std::ifstream(fn)), local_is(true) { 2398 if (!(*_is)) throw IoError("Cannot open file", fn); 2419 if (!(*_is)) { 2420 delete _is; 2421 throw IoError("Cannot open file", fn); 2422 } 2399 2423 } 2400 2424
Note: See TracChangeset
for help on using the changeset viewer.