mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-21 09:15:46 +01:00
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).
This commit is contained in:
@@ -129,7 +129,9 @@ createView(W_Screen *screen, W_View *parent)
|
|||||||
|
|
||||||
adoptChildView(parent, view);
|
adoptChildView(parent, view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
view->refCount = 1;
|
||||||
|
|
||||||
view->eventHandlers = WMCreateBag(4);
|
view->eventHandlers = WMCreateBag(4);
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
@@ -465,8 +467,11 @@ destroyView(W_View *view)
|
|||||||
void
|
void
|
||||||
W_DestroyView(W_View *view)
|
W_DestroyView(W_View *view)
|
||||||
{
|
{
|
||||||
if (view->refCount == 0)
|
view->refCount--;
|
||||||
destroyView(view);
|
|
||||||
|
if (view->refCount < 1) {
|
||||||
|
destroyView(view);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -672,7 +677,7 @@ W_ReleaseView(WMView *view)
|
|||||||
{
|
{
|
||||||
view->refCount--;
|
view->refCount--;
|
||||||
|
|
||||||
if (view->refCount < 0) {
|
if (view->refCount < 1) {
|
||||||
destroyView(view);
|
destroyView(view);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user