From 9093cde8175ae0fad677492fe3cab9474c57ed5c Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 1 Jan 2001 08:39:26 +0000 Subject: [PATCH] Fixed the no-go-away problem with closing shaded windows. This also fixes a memory leak (the window didn't go away because its destroy function was not actually called. Also non-shaded windows were unmapped, but not destroyed either, so they just apparently went away). --- WINGs/wview.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/WINGs/wview.c b/WINGs/wview.c index 9e29eeb9..7aca95e7 100644 --- a/WINGs/wview.c +++ b/WINGs/wview.c @@ -129,7 +129,9 @@ createView(W_Screen *screen, W_View *parent) adoptChildView(parent, view); } - + + view->refCount = 1; + view->eventHandlers = WMCreateBag(4); return view; @@ -465,8 +467,11 @@ destroyView(W_View *view) void W_DestroyView(W_View *view) { - if (view->refCount == 0) - destroyView(view); + view->refCount--; + + if (view->refCount < 1) { + destroyView(view); + } } @@ -672,7 +677,7 @@ W_ReleaseView(WMView *view) { view->refCount--; - if (view->refCount < 0) { + if (view->refCount < 1) { destroyView(view); } }