| 59 | } |
| 60 | |
| 61 | BinaryFileStream::~BinaryFileStream() |
| 62 | { |
| 63 | if (fileOpen == 1) |
| 64 | theFile.close(); |
| 65 | |
| 66 | if (theChannels != 0) { |
| 67 | |
| 68 | static ID lastMsg(1); |
| 69 | if (sendSelfCount > 0) { |
| 70 | for (int i=0; i<sendSelfCount; i++) |
| 71 | theChannels[i]->sendID(0, 0, lastMsg); |
| 72 | } else |
| 73 | theChannels[0]->recvID(0, 0, lastMsg); |
| 74 | delete [] theChannels; |
| 75 | } |
| 76 | |
| 77 | if (fileName != 0) |
| 78 | delete [] fileName; |
| 79 | |
| 80 | if (sendSelfCount > 0) { |
| 81 | |
| 82 | for (int i=0; i<=sendSelfCount; i++) { |
| 83 | if (theColumns[i] != 0) |
| 84 | delete theColumns[i]; |
| 85 | |
| 86 | if (theData[i] != 0) |
| 87 | delete [] theData[i]; |
| 88 | |
| 89 | if (theRemoteData[i] != 0) |
| 90 | delete theRemoteData[i]; |
| 91 | } |
| 92 | delete [] theData; |
| 93 | delete [] theRemoteData; |
| 94 | delete [] theColumns; |
| 95 | delete sizeColumns; |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | int |
| 100 | BinaryFileStream::setFile(const char *name, openMode mode) |