Parcourir la source

Fixed a small memory leak
Author: jgg
Date: 1999-07-03 06:45:40 GMT
Fixed a small memory leak

Arch Librarian il y a 22 ans
Parent
commit
29f7b36cd6
2 fichiers modifiés avec 12 ajouts et 3 suppressions
  1. 9 1
      apt-pkg/tagfile.cc
  2. 3 2
      apt-pkg/tagfile.h

+ 9 - 1
apt-pkg/tagfile.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: tagfile.cc,v 1.24 1999/02/22 03:30:06 jgg Exp $
+// $Id: tagfile.cc,v 1.25 1999/07/03 06:45:40 jgg Exp $
 /* ######################################################################
 
    Fast scanner for RFC-822 type header information
@@ -35,6 +35,14 @@ pkgTagFile::pkgTagFile(FileFd &Fd,unsigned long Size) : Fd(Fd), Size(Size)
    Fill();
 }
 									/*}}}*/
+// pkgTagFile::~pkgTagFile - Destructor					/*{{{*/
+// ---------------------------------------------------------------------
+/* */
+pkgTagFile::~pkgTagFile()
+{
+   delete [] Buffer;
+}
+									/*}}}*/
 // TagFile::Step - Advance to the next section				/*{{{*/
 // ---------------------------------------------------------------------
 /* If the Section Scanner fails we refill the buffer and try again. */

+ 3 - 2
apt-pkg/tagfile.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: tagfile.h,v 1.13 1998/12/14 02:23:47 jgg Exp $
+// $Id: tagfile.h,v 1.14 1999/07/03 06:45:40 jgg Exp $
 /* ######################################################################
 
    Fast scanner for RFC-822 type header information
@@ -81,8 +81,9 @@ class pkgTagFile
    bool Step(pkgTagSection &Section);
    inline unsigned long Offset() {return iOffset;};
    bool Jump(pkgTagSection &Tag,unsigned long Offset);
-   
+
    pkgTagFile(FileFd &F,unsigned long Size = 32*1024);
+   ~pkgTagFile();
 };
 
 #endif