[dev] [tabbed] bug in cleanup function

From: Ivan Vetrov <vetrov.iv5_AT_gmail.com>
Date: Thu, 6 Nov 2025 11:49:20 +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 regards,
Ivan

Received on Thu Nov 06 2025 - 09:49:20 CET

This archive was generated by hypermail 2.3.0 : Thu Nov 06 2025 - 10:24:08 CET