rem: index = WMFindInArray(scr->fakeGroupLeaders, matchWindow, (void*)window); if (index != WANotFound) {
add: while ((index = WMFindInArray(scr->fakeGroupLeaders, matchWindow, (void*)window)) != WANotFound) {
context: handleDestroyNotify(XEvent *event){    WWindow *wwin;    WApplication *app;    Window window = event->xdestroywindow.window;    WScreen *scr = wScreenForRootWindow(event->xdestroywindow.event);    int index;#ifdef DEBUG    L("got destroy notify");#endif    wwin = wWindowFor(window);    if (wwin) {	wUnmanageWindow(wwin, False, True);    }    index = WMFindInArray(scr->fakeGroupLeaders, matchWindow, (void*)window);    if (index != WANotFound) {        WFakeGroupLeader *fPtr;        fPtr = WMGetFromArray(scr->fakeGroupLeaders, index);        if (fPtr->retainCount > 0) {            fPtr->retainCount--;            if (fPtr->retainCount==0 && fPtr->leader!=None) {                XDestroyWindow(dpy, fPtr->leader);                fPtr->leader = None;                XFlush(dpy);            }        }        fPtr->origLeader = None;    }    app = wApplicationOf(window);    if (app) {	if (window == app->main_window) {	    app->refcount = 0;	    wwin = app->main_window_desc->screen_ptr->focused_window;	    while (wwin) {		if (wwin->main_window == window) {		    wwin->main_window = None;		}		wwin = wwin->prev;	    }	}	wApplicationDestroy(app);    }    #ifdef KWM_HINTS    wKWMCheckDestroy(&event->xdestroywindow);#endif}