You don't need to sync() in this situation, because the object gets synced when it's deleted. Does the signal handler actually get called?
You don't need to sync() in this situation, because the object gets synced when it's deleted. Does the signal handler actually get called?
Also, looks like you create a new MainWindow object in sighandler(). It's not the original window you have shown but another object..
J-P Nurmi
It worked now, it was just the way I was calling the writeSettings function.
Here is the way I handled the signal for MainWindow.
signal(SIGTERM, MainWindow::writeSettings);
And declared static void writeSettings(int sigNum); in header file under public.
And thus this function has been called when SIGTERM signal is caught.
Thanks to all who supported me in correcting me from doing faults.
Bookmarks