]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Trigger finishShutdown runners event before pooled memory is released
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 21 Apr 2014 05:13:31 +0000 (22:13 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 21 Apr 2014 05:13:31 +0000 (22:13 -0700)
This allows runner destructors to operate their cleanup even if the
component memory they are cleaning up is pooled.

src/base/RunnersRegistry.h
src/main.cc

index d0e369c20893d1e7c5344ecc1dc3a3e3d62fefa3..8a401651cf43d768f42403755ab9b1aa01089f96 100644 (file)
@@ -60,7 +60,7 @@ public:
     /// Meant for cleanup and state saving that may require other modules.
     virtual void startShutdown() {}
 
-    /// Called after stopping the main loop.
+    /// Called after stopping the main loop and before releasing memory.
     /// Meant for quick/basic cleanup that does not require any other modules.
     virtual ~RegisteredRunner() {}
     /// exists to simplify caller interface; override the destructor instead
index 59d24b8a62a52772d014c2c5b81446970c9dcfac..09d0616b6c6c4213ad8edf6bc8d02b850ecb7a5f 100644 (file)
@@ -1907,10 +1907,10 @@ SquidShutdown()
 
     comm_exit();
 
-    memClean();
-
     RunRegisteredHere(RegisteredRunner::finishShutdown);
 
+    memClean();
+
     if (IamPrimaryProcess()) {
         if (Config.pidFilename && strcmp(Config.pidFilename, "none") != 0) {
             enter_suid();