summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2009-08-22 08:10:52 -0700
committerDaniel Burrows <dburrows@debian.org>2009-08-22 08:10:52 -0700
commit88ddbf58b0f7c0da3992ba413566ab71cffb6837 (patch)
tree3973e8c69602dc0904daf94163d47a1a75497984 /src/main.cc
parent451c75a9023eefe1fa962683bba69d859f8fe2f8 (diff)
downloadaptitude-88ddbf58b0f7c0da3992ba413566ab71cffb6837.tar.gz
Add an apt_shutdown() routine that destroys the global structures that aren't destroyed by apt_close_cache().
This would be the destructor of the "aptitude session" object if there was one.
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.cc b/src/main.cc
index 21271ddc..972bbee4 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -477,7 +477,10 @@ public:
// can trigger aborts when the static flyweight pool is destroyed.
//
// TBH, I think it might be worth writing our own flyweight stand-in
-// to avoid this particular bit of stupid.
+// to avoid this particular bit of stupid. On the other hand, it
+// might be better to fully shut down the cache all the time, to
+// better detect leaks and so on? I'm undecided -- and it shouldn't
+// take too long to clear out the cache.
struct close_cache_on_exit
{
close_cache_on_exit()
@@ -486,7 +489,7 @@ struct close_cache_on_exit
~close_cache_on_exit()
{
- apt_close_cache();
+ apt_shutdown();
}
};