]> granicus.if.org Git - taglib/commitdiff
Fixed (huge) memory leak with ASF.
authorBirunthan Mohnathas <birunthan@mohanathas.com>
Mon, 12 Mar 2012 16:44:08 +0000 (18:44 +0200)
committerBirunthan Mohnathas <birunthan@mohanathas.com>
Mon, 12 Mar 2012 16:44:08 +0000 (18:44 +0200)
taglib/asf/asffile.cpp

index 336ef35bca38e88c40fa6bc54ccaad3f12d14afc..2edff441e7eee157acb592481809391ab769cbfd 100644 (file)
@@ -142,11 +142,19 @@ class ASF::File::HeaderExtensionObject : public ASF::File::BaseObject
 {
 public:
   List<ASF::File::BaseObject *> objects;
+  ~HeaderExtensionObject();
   ByteVector guid();
   void parse(ASF::File *file, uint size);
   ByteVector render(ASF::File *file);
 };
 
+ASF::File::HeaderExtensionObject::~HeaderExtensionObject()
+{
+  for(unsigned int i = 0; i < objects.size(); i++) {
+    delete objects[i];
+  }
+}
+
 void ASF::File::BaseObject::parse(ASF::File *file, unsigned int size)
 {
   data.clear();