[Aptitude-svn-commit] r3875 - in branches/aptitude-0.3/aptitude: . src/generic

Daniel Burrows dburrows at costa.debian.org
Tue Aug 16 23:44:36 UTC 2005


Author: dburrows
Date: Tue Aug 16 23:44:33 2005
New Revision: 3875

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/apt.cc
Log:
Really null out the memoization when the cache is reloaded; do the same if Recommends-Important changes.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Aug 16 23:44:33 2005
@@ -2,6 +2,12 @@
 
 	* src/generic/apt.cc:
 
+	  Fix the deletion of cached_deps_interesting on a cache reload,
+	  and set it up to also be deleted+reset when the
+	  Recommends-Important variable is modified.
+
+	* src/generic/apt.cc:
+
 	  Only treat currently satisfied recommendations as interesting if
 	  they belong to the current package version OR they subsume/are
 	  subsumed by a recommendation of the current version.

Modified: branches/aptitude-0.3/aptitude/src/generic/apt.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/apt.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/apt.cc	Tue Aug 16 23:44:33 2005
@@ -68,6 +68,12 @@
 sigc::signal0<void> hier_reloaded;
 sigc::signal0<void> consume_errors;
 
+static void reset_interesting_dep_memoization()
+{
+  delete cached_deps_interesting;
+  cached_deps_interesting = NULL;
+}
+
 static void reload_user_pkg_hier()
 {
   delete user_pkg_hier;
@@ -116,6 +122,11 @@
 
   aptcfg=new signalling_config(user_config, _config, theme_config);
 
+  aptcfg->connect(PACKAGE "::Recommends-Important",
+		  sigc::ptr_fun(&reset_interesting_dep_memoization));
+
+  cache_closed.connect(sigc::ptr_fun(&reset_interesting_dep_memoization));
+
   apt_dumpcfg("Aptitude");
 
   apt_undos=new undo_list;
@@ -210,11 +221,6 @@
       apt_source_list=NULL;
     }
 
-  if(cached_deps_interesting)
-    {
-      delete[] cached_deps_interesting;
-    }
-
   aptitudeCacheFile *new_file=new aptitudeCacheFile;
 
   apt_source_list=new pkgSourceList;



More information about the Aptitude-svn-commit mailing list