mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-30 18:32:34 +01:00
WINGs: Fix crash on exit while trying to save user config changes
Recent patches has introduced the ability to exit cleanly from the WINGs library, but this introduced some side effects because a function is registered with 'atexit' to save user config on exit, which may not work anymore because WMReleaseApplication frees some stuff needed for that task. This patch handles this so that both method works, in case user of the lib would forget to call the clean exit function. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
1b2e8a6491
commit
a2328d9842
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "WINGsP.h"
|
||||
#include "wconfig.h"
|
||||
#include "userdefaults.h"
|
||||
|
||||
|
||||
struct W_Application WMApplication;
|
||||
@@ -51,6 +52,14 @@ void WMInitializeApplication(const char *applicationName, int *argc, char **argv
|
||||
void WMReleaseApplication(void) {
|
||||
int i;
|
||||
|
||||
/*
|
||||
* We save the configuration on exit, this used to be handled
|
||||
* through an 'atexit' registered function but if application
|
||||
* properly calls WMReleaseApplication then the info to that
|
||||
* will have been freed by us.
|
||||
*/
|
||||
w_save_defaults_changes();
|
||||
|
||||
W_ReleaseNotificationCenter();
|
||||
|
||||
if (WMApplication.applicationName)
|
||||
|
||||
Reference in New Issue
Block a user