---
 WINGs/WINGs/WINGs.h  |  3 ++-
 WINGs/notification.c | 12 ++++++++++++
 WINGs/wapplication.c | 11 +++++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/WINGs/WINGs/WINGs.h b/WINGs/WINGs/WINGs.h
index aa95844..6597504 100644
--- a/WINGs/WINGs/WINGs.h
+++ b/WINGs/WINGs/WINGs.h
@@ -642,9 +642,10 @@ WMRect wmkrect(int x, int y, unsigned int width,
unsigned int height);
 /* ---[ WINGs/wapplication.c ]-------------------------------------------- */


-
 void WMInitializeApplication(const char *applicationName, int *argc,
char **argv);

+void WMReleaseApplication();
+
 void WMSetResourcePath(const char *path);

 /* don't free the returned string */
diff --git a/WINGs/notification.c b/WINGs/notification.c
index ada942f..ebb05ec 100644
--- a/WINGs/notification.c
+++ b/WINGs/notification.c
@@ -94,6 +94,18 @@ void W_InitNotificationCenter(void)
  notificationCenter->observerTable = WMCreateHashTable(WMIntHashCallbacks);
 }

+void WMReleaseNotificationCenter()
+{
+ if (notificationCenter->nameTable)
+ WMFreeHashTable(notificationCenter->nameTable);
+ if (notificationCenter->objectTable)
+ WMFreeHashTable(notificationCenter->objectTable);
+ if (notificationCenter->observerTable)
+ WMFreeHashTable(notificationCenter->observerTable);
+ if (notificationCenter)
+ wfree(notificationCenter);
+}
+
 void
 WMAddNotificationObserver(WMNotificationObserverAction * observerAction,
   void *observer, const char *name, void *object)
diff --git a/WINGs/wapplication.c b/WINGs/wapplication.c
index a0aec2e..84ede06 100644
--- a/WINGs/wapplication.c
+++ b/WINGs/wapplication.c
@@ -48,6 +48,17 @@ void WMInitializeApplication(const char
*applicationName, int *argc, char **argv
  W_InitNotificationCenter();
 }

+void WMReleaseApplication() {
+ int i =0;
+ if (WMApplication.applicationName)
+ wfree(WMApplication.applicationName);
+ for (i = 0; i < WMApplication.argc; i++)
+ wfree(WMApplication.argv[i]);
+ if (WMApplication.argv)
+ wfree(WMApplication.argv);
+ WMReleaseNotificationCenter();
+}
+
 void WMSetResourcePath(const char *path)
 {
  if (WMApplication.resourcePath)
-- 
1.8.3.2

Attachment: 0001-Added-cleaned-function-in-wings.patch
Description: Binary data

Reply via email to