From 5077d3800e3405f574cefb7695cf2db6bc5767eb Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 13 Dec 2009 14:22:47 +0000 Subject: [PATCH] Add destructor to Protocol::PacketDef --- source/protocol.h | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.43.0