summaryrefslogtreecommitdiff
path: root/zen/shutdown.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-04-18 13:48:31 +0000
committerB. Stack <bgstack15@gmail.com>2022-04-18 13:48:31 +0000
commit8a551d2eff24bdd23bc25caeb8d17207409aae38 (patch)
tree84e67ca0a1fb045a12d015fcffca9cd8087c9332 /zen/shutdown.h
parentMerge branch 'b11.18' into 'master' (diff)
parentadd upstream 11.20 (diff)
downloadFreeFileSync-8a551d2eff24bdd23bc25caeb8d17207409aae38.tar.gz
FreeFileSync-8a551d2eff24bdd23bc25caeb8d17207409aae38.tar.bz2
FreeFileSync-8a551d2eff24bdd23bc25caeb8d17207409aae38.zip
Merge branch 'b11.20' into 'master'11.20
add upstream 11.20 See merge request opensource-tracking/FreeFileSync!43
Diffstat (limited to 'zen/shutdown.h')
-rw-r--r--zen/shutdown.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/zen/shutdown.h b/zen/shutdown.h
index 20354a14..b4d51f69 100644
--- a/zen/shutdown.h
+++ b/zen/shutdown.h
@@ -7,6 +7,7 @@
#ifndef SHUTDOWN_H_3423847870238407783265
#define SHUTDOWN_H_3423847870238407783265
+#include <functional>
#include "file_error.h"
@@ -15,6 +16,11 @@ namespace zen
void shutdownSystem(); //throw FileError
void suspendSystem(); //
[[noreturn]] void terminateProcess(int exitCode);
+
+void onSystemShutdownRegister(const SharedRef<std::function<void()>>& task /*noexcept*/); //save important/user data!
+void onSystemShutdownRegister( SharedRef<std::function<void()>>&& task) = delete; //no temporaries! shared_ptr should manage life time!
+void onSystemShutdownRunTasks(); //call at appropriate time, e.g. when receiving wxEVT_QUERY_END_SESSION/wxEVT_END_SESSION
+//+ also called by shutdownSystem()
}
#endif //SHUTDOWN_H_3423847870238407783265
bgstack15