diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-06-25 03:20:54 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-06-25 03:20:54 +0200 |
commit | 2305fcbba7885e529f84742fb5d9a56fb206c650 (patch) | |
tree | 80c94320bb3cb9e130191b8901de4fcde12c4253 /src | |
parent | 725ed2a06c5e376168dc1552d52cf0b77ed5c073 (diff) | |
download | mad-2305fcbba7885e529f84742fb5d9a56fb206c650.tar mad-2305fcbba7885e529f84742fb5d9a56fb206c650.zip |
Daten-Puffer im Destruktor deallozieren
Diffstat (limited to 'src')
-rw-r--r-- | src/Net/Connection.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Net/Connection.h b/src/Net/Connection.h index d13c2f6..42e0c8e 100644 --- a/src/Net/Connection.h +++ b/src/Net/Connection.h @@ -73,9 +73,19 @@ class Connection { public: Connection() { transR.length = transR.transmitted = 0; + transR.data = 0; } - virtual ~Connection() {} + virtual ~Connection() { + if(transR.data) + delete [] transR.data; + + while(!sendQueueEmpty()) { + delete [] transS.front().data; + transS.pop(); + } + + } virtual bool isConnected() const = 0; virtual const IPAddress* getPeer() const = 0; |