Changeset 295:7c796c1cf1b0 in lemon-main for lemon/lgf_writer.h
- Timestamp:
- 10/05/08 21:09:01 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/lgf_writer.h
r294 r295 464 464 : _os(new std::ofstream(fn.c_str())), local_os(true), _digraph(digraph), 465 465 _skip_nodes(false), _skip_arcs(false) { 466 if (!(*_os)) throw IoError("Cannot write file", fn); 466 if (!(*_os)) { 467 delete _os; 468 throw IoError("Cannot write file", fn); 469 } 467 470 } 468 471 … … 474 477 : _os(new std::ofstream(fn)), local_os(true), _digraph(digraph), 475 478 _skip_nodes(false), _skip_arcs(false) { 476 if (!(*_os)) throw IoError("Cannot write file", fn); 479 if (!(*_os)) { 480 delete _os; 481 throw IoError("Cannot write file", fn); 482 } 477 483 } 478 484 … … 1025 1031 : _os(new std::ofstream(fn.c_str())), local_os(true), _graph(graph), 1026 1032 _skip_nodes(false), _skip_edges(false) { 1027 if (!(*_os)) throw IoError("Cannot write file", fn); 1033 if (!(*_os)) { 1034 delete _os; 1035 throw IoError("Cannot write file", fn); 1036 } 1028 1037 } 1029 1038 … … 1035 1044 : _os(new std::ofstream(fn)), local_os(true), _graph(graph), 1036 1045 _skip_nodes(false), _skip_edges(false) { 1037 if (!(*_os)) throw IoError("Cannot write file", fn); 1046 if (!(*_os)) { 1047 delete _os; 1048 throw IoError("Cannot write file", fn); 1049 } 1038 1050 } 1039 1051 … … 1588 1600 SectionWriter(const std::string& fn) 1589 1601 : _os(new std::ofstream(fn.c_str())), local_os(true) { 1590 if (!(*_os)) throw IoError("Cannot write file", fn); 1602 if (!(*_os)) { 1603 delete _os; 1604 throw IoError("Cannot write file", fn); 1605 } 1591 1606 } 1592 1607 … … 1596 1611 SectionWriter(const char* fn) 1597 1612 : _os(new std::ofstream(fn)), local_os(true) { 1598 if (!(*_os)) throw IoError("Cannot write file", fn); 1613 if (!(*_os)) { 1614 delete _os; 1615 throw IoError("Cannot write file", fn); 1616 } 1599 1617 } 1600 1618
Note: See TracChangeset
for help on using the changeset viewer.