From: Christophe CURIS <christophe.cu...@free.fr> The function would not behave correctly if called twice, and the library may re-use de-allocated pointers if calling WINGs functions after calling this function.
The goal is for our library to behave as cleanly as possible, so that users may have a clearer hint in case of misuse on their side to debug the problem. Signed-off-by: Christophe CURIS <christophe.cu...@free.fr> --- WINGs/wapplication.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/WINGs/wapplication.c b/WINGs/wapplication.c index 1478ced..90874c0 100644 --- a/WINGs/wapplication.c +++ b/WINGs/wapplication.c @@ -62,14 +62,18 @@ void WMReleaseApplication(void) { W_ReleaseNotificationCenter(); - if (WMApplication.applicationName) + if (WMApplication.applicationName) { wfree(WMApplication.applicationName); + WMApplication.applicationName = NULL; + } - for (i = 0; i < WMApplication.argc; i++) - wfree(WMApplication.argv[i]); + if (WMApplication.argv) { + for (i = 0; i < WMApplication.argc; i++) + wfree(WMApplication.argv[i]); - if (WMApplication.argv) wfree(WMApplication.argv); + WMApplication.argv = NULL; + } } void WMSetResourcePath(const char *path) -- 1.9.2 -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.