| 71 | } |
| 72 | |
| 73 | BinaryFileStream::~BinaryFileStream() |
| 74 | { |
| 75 | if (fileOpen == 1) |
| 76 | theFile.close(); |
| 77 | |
| 78 | if (theChannels != 0) { |
| 79 | |
| 80 | static ID lastMsg(1); |
| 81 | if (sendSelfCount > 0) { |
| 82 | for (int i = 0; i < sendSelfCount; ++i) |
| 83 | theChannels[i]->sendID(0, 0, lastMsg); |
| 84 | } else |
| 85 | theChannels[0]->recvID(0, 0, lastMsg); |
| 86 | delete[] theChannels; |
| 87 | } |
| 88 | |
| 89 | if (fileName != 0) |
| 90 | delete[] fileName; |
| 91 | |
| 92 | if (sendSelfCount > 0) { |
| 93 | |
| 94 | for (int i = 0; i <= sendSelfCount; ++i) { |
| 95 | if (theColumns[i] != 0) |
| 96 | delete theColumns[i]; |
| 97 | |
| 98 | if (theData[i] != 0) |
| 99 | delete[] theData[i]; |
| 100 | |
| 101 | if (theRemoteData[i] != 0) |
| 102 | delete theRemoteData[i]; |
| 103 | } |
| 104 | delete[] theData; |
| 105 | delete[] theRemoteData; |
| 106 | delete[] theColumns; |
| 107 | delete sizeColumns; |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | int |
| 112 | BinaryFileStream::setFile(const char* name, openMode mode) |