From: Christophe CURIS <christophe.cu...@free.fr>

Factually, the program works because the function 'drawerRemoveFromChain'
uses only the address of the drawer and not the content of the structure,
but conceptually this address point to a storage space that has been
de-allocated, so that's calling for trouble for future code changes.

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 src/dock.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/dock.c b/src/dock.c
index 3fd3dbe..8b93a50 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -4448,13 +4448,15 @@ static void drawerDestroy(WDock *drawer)
 
        wAppIconDestroy(drawer->icon_array[0]);
        wfree(drawer->icon_array);
-       wfree(drawer);
+       drawer->icon_array = NULL;
 
        drawerRemoveFromChain(scr, drawer);
        if (scr->last_dock == drawer)
                scr->last_dock = NULL;
        if (scr->attracting_drawer == drawer)
                scr->attracting_drawer = NULL;
+
+       wfree(drawer);
 }
 
 
-- 
1.9.2


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to