From 2305fcbba7885e529f84742fb5d9a56fb206c650 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 25 Jun 2008 03:20:54 +0200 Subject: Daten-Puffer im Destruktor deallozieren --- src/Net/Connection.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/Net') 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; -- cgit v1.2.3