Просмотр исходного кода

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

Arch Librarian лет назад: 22
Родитель
Сommit
29f7b36cd6
2 измененных файлов с 12 добавлено и 3 удалено
  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 -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // 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
    Fast scanner for RFC-822 type header information
@@ -35,6 +35,14 @@ pkgTagFile::pkgTagFile(FileFd &Fd,unsigned long Size) : Fd(Fd), Size(Size)
    Fill();
    Fill();
 }
 }
 									/*}}}*/
 									/*}}}*/
+// pkgTagFile::~pkgTagFile - Destructor					/*{{{*/
+// ---------------------------------------------------------------------
+/* */
+pkgTagFile::~pkgTagFile()
+{
+   delete [] Buffer;
+}
+									/*}}}*/
 // TagFile::Step - Advance to the next section				/*{{{*/
 // TagFile::Step - Advance to the next section				/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* If the Section Scanner fails we refill the buffer and try again. */
 /* 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 -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // 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
    Fast scanner for RFC-822 type header information
@@ -81,8 +81,9 @@ class pkgTagFile
    bool Step(pkgTagSection &Section);
    bool Step(pkgTagSection &Section);
    inline unsigned long Offset() {return iOffset;};
    inline unsigned long Offset() {return iOffset;};
    bool Jump(pkgTagSection &Tag,unsigned long Offset);
    bool Jump(pkgTagSection &Tag,unsigned long Offset);
-   
+
    pkgTagFile(FileFd &F,unsigned long Size = 32*1024);
    pkgTagFile(FileFd &F,unsigned long Size = 32*1024);
+   ~pkgTagFile();
 };
 };
 
 
 #endif
 #endif