]> git.tdb.fi Git - libs/net.git/commitdiff
Add destructor to Protocol::PacketDef
authorMikko Rasa <tdb@tdb.fi>
Sun, 13 Dec 2009 14:22:47 +0000 (14:22 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sun, 13 Dec 2009 14:22:47 +0000 (14:22 +0000)
source/protocol.h

index 082687b3b1537c40b96ee9f9a86158d8d50bd38a..5d1a8746d196b9b7e021e8f15c385729d4728c4e 100644 (file)
@@ -72,6 +72,12 @@ protected:
                PacketDef(unsigned i): PacketDefBase(i)
                { if(!class_id) class_id=next_class_id++; }
 
+               ~PacketDef()
+               {
+                       for(typename std::vector<FieldBase<P> *>::const_iterator i=fields.begin(); i!=fields.end(); ++i)
+                               delete *i;
+               }
+
                virtual unsigned get_class_id() const { return class_id; }
 
                template<typename T>