From d715b9c969264eec96913b577f63a3e9e498b2e6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 21 Feb 2007 09:59:53 +0100 Subject: * fix in the pkgRecords destructor * Bump ABI version --- apt-pkg/init.h | 2 +- apt-pkg/makefile | 2 +- apt-pkg/pkgrecords.cc | 16 +++++++++------- apt-pkg/pkgrecords.h | 5 +++-- 4 files changed, 14 insertions(+), 11 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/init.h b/apt-pkg/init.h index 0e91f164d..905173a7a 100644 --- a/apt-pkg/init.h +++ b/apt-pkg/init.h @@ -18,7 +18,7 @@ // See the makefile #define APT_PKG_MAJOR 3 -#define APT_PKG_MINOR 52 +#define APT_PKG_MINOR 53 #define APT_PKG_RELEASE 0 extern const char *pkgVersion; diff --git a/apt-pkg/makefile b/apt-pkg/makefile index 10b012774..d36747d85 100644 --- a/apt-pkg/makefile +++ b/apt-pkg/makefile @@ -13,7 +13,7 @@ include ../buildlib/defaults.mak # methods/makefile - FIXME LIBRARY=apt-pkg LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER) -MAJOR=3.52 +MAJOR=3.53 MINOR=0 SLIBS=$(PTHREADLIB) $(INTLLIBS) APT_DOMAIN:=libapt-pkg$(MAJOR) diff --git a/apt-pkg/pkgrecords.cc b/apt-pkg/pkgrecords.cc index b22f3e73f..456b5aef4 100644 --- a/apt-pkg/pkgrecords.cc +++ b/apt-pkg/pkgrecords.cc @@ -23,11 +23,9 @@ // Records::pkgRecords - Constructor /*{{{*/ // --------------------------------------------------------------------- /* This will create the necessary structures to access the status files */ -pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), Files(0) +pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), + Files(Cache.HeaderP->PackageFileCount) { - Files = new Parser *[Cache.HeaderP->PackageFileCount]; - memset(Files,0,sizeof(*Files)*Cache.HeaderP->PackageFileCount); - for (pkgCache::PkgFileIterator I = Cache.FileBegin(); I.end() == false; I++) { @@ -49,9 +47,13 @@ pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), Files(0) /* */ pkgRecords::~pkgRecords() { - for (unsigned I = 0; I != Cache.HeaderP->PackageFileCount; I++) - delete Files[I]; - delete [] Files; + for ( vector::iterator it = Files.begin(); + it != Files.end(); + ++it) + { + delete *it; + } + } /*}}}*/ // Records::Lookup - Get a parser for the package version file /*{{{*/ diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h index 31c444dbf..ad3946c1b 100644 --- a/apt-pkg/pkgrecords.h +++ b/apt-pkg/pkgrecords.h @@ -23,6 +23,7 @@ #include #include +#include class pkgRecords { @@ -32,8 +33,8 @@ class pkgRecords private: pkgCache &Cache; - Parser **Files; - + std::vectorFiles; + public: // Lookup function -- cgit v1.2.3