[dev] [tabbed] bug in cleanup function

From: Ivan Vetrov <vetrov.iv5_AT_gmail.com>
Date: Wed, 5 Nov 2025 16:44:43 +0300

Hi,

In the `cleanup` function there is a loop

        for (i = 0; i < nclients; i++) {
                focus(i);
                killclient(NULL);
                XReparentWindow(dpy, clients[i]->win, root, 0, 0);
                unmanage(i);
        }

which is buggy because `unmanage` decreases the global variable `nclients` by
one and also affects the memory pointed to by `clients`, so it actually
destroys only clients with even indices. I think it can be fixed by destroying
the 0th client `nclients` times or by iterating in reverse order (as in the
attached patch).

Best,
Ivan

Received on Wed Nov 05 2025 - 14:44:43 CET

This archive was generated by hypermail 2.3.0 : Thu Nov 06 2025 - 18:48:09 CET