Commit 2275b41d authored by Aleksy Barcz's avatar Aleksy Barcz

Removed signal handlers from draw3

+ caused deadlocks on program exit, as functions called from signal handler were not async-signal-safe (see: man signal-safety). Amongst others, malloc and pthread_join are not safe.
+ OS will cleanup our threads and db queue anyway
+ saving defined user params on exit is no longer necessary as we save them on every edit action
+ because of all the above, we can safely leave signal handling and cleanup to standard OS behavior on Linux
parent fa07d5a9
......@@ -151,12 +151,6 @@ extern void InitXmlResource();
bool read_only;
std::unique_ptr<FileLocker> m_instance;
void handler(int sig)
namespace {
......@@ -241,9 +235,6 @@ bool DrawApp::OnInit() {
SetProgName(_T("Draw 3"));
signal(SIGHUP, handler);
signal(SIGINT, handler);
signal(SIGTERM, handler);
if (m_just_print_version) {
std::cout << SZARP_VERSION << std::endl;
......@@ -96,7 +96,7 @@ class DrawApp : public DrawGLApp
* Method called on application end and on sigint.
* Method called on application end.
int OnExit();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment