This allows runner destructors to operate their cleanup even if the
component memory they are cleaning up is pooled.
/// 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
comm_exit();
- memClean();
-
RunRegisteredHere(RegisteredRunner::finishShutdown);
+ memClean();
+
if (IamPrimaryProcess()) {
if (Config.pidFilename && strcmp(Config.pidFilename, "none") != 0) {
enter_suid();