[FarGroup/FarManager] master: Continue 6677.2 (a59729564)

0 views
Skip to first unread message

farg...@farmanager.com

unread,
May 9, 2026, 8:15:57 AMMay 9
to farco...@googlegroups.com
Repository : https://github.com/FarGroup/FarManager
On branch : master
Link : https://github.com/FarGroup/FarManager/commit/a597295643ec22d529f569928b283d2cbfdccdba

>---------------------------------------------------------------

commit a597295643ec22d529f569928b283d2cbfdccdba
Author: Alex Alabuzhev <alab...@gmail.com>
Date: Sat May 9 13:06:58 2026 +0100

Continue 6677.2


>---------------------------------------------------------------

a597295643ec22d529f569928b283d2cbfdccdba
far/exception_handler.cpp | 5 +++++
far/exception_handler.hpp | 1 +
far/main.cpp | 6 +++++-
3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/far/exception_handler.cpp b/far/exception_handler.cpp
index eb7a0dbce..228d333c9 100644
--- a/far/exception_handler.cpp
+++ b/far/exception_handler.cpp
@@ -162,6 +162,11 @@ void disable_exception_handling()
LOGWARNING(L"Exception handling disabled"sv);
}

+bool is_exception_handling_enabled()
+{
+ return HandleCppExceptions && HandleSehExceptions;
+}
+
static std::atomic_bool s_ExceptionHandlingInprogress{};
bool exception_handling_in_progress()
{
diff --git a/far/exception_handler.hpp b/far/exception_handler.hpp
index e36af376e..11823c5c4 100644
--- a/far/exception_handler.hpp
+++ b/far/exception_handler.hpp
@@ -52,6 +52,7 @@ void report_to_stderr();
void set_report_location(string_view Directory);

void disable_exception_handling();
+bool is_exception_handling_enabled();

bool exception_handling_in_progress();

diff --git a/far/main.cpp b/far/main.cpp
index ed88b5652..9e44dccc5 100644
--- a/far/main.cpp
+++ b/far/main.cpp
@@ -869,7 +869,11 @@ static void register_restart(bool const HasArgs)
return CommandLine + ExecutableSize + 1;
}() : nullptr;

- if (const auto Result = imports.RegisterApplicationRestart(Args, 0); FAILED(Result))
+ const auto Flags = is_exception_handling_enabled()?
+ 0 :
+ RESTART_NO_CRASH | RESTART_NO_HANG;
+
+ if (const auto Result = imports.RegisterApplicationRestart(Args, Flags); FAILED(Result))
LOGWARNING(L"RegisterApplicationRestart(): {}"sv, os::format_error(Result));
}



Reply all
Reply to author
Forward
0 new messages