From: Mikko Rasa Date: Sun, 13 Dec 2009 14:22:47 +0000 (+0000) Subject: Add destructor to Protocol::PacketDef X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=5077d3800e3405f574cefb7695cf2db6bc5767eb;p=libs%2Fnet.git Add destructor to Protocol::PacketDef --- diff --git a/source/protocol.h b/source/protocol.h index 082687b..5d1a874 100644 --- a/source/protocol.h +++ b/source/protocol.h @@ -72,6 +72,12 @@ protected: PacketDef(unsigned i): PacketDefBase(i) { if(!class_id) class_id=next_class_id++; } + ~PacketDef() + { + for(typename std::vector *>::const_iterator i=fields.begin(); i!=fields.end(); ++i) + delete *i; + } + virtual unsigned get_class_id() const { return class_id; } template