The attached test program is enough to see the issue without the patch (in wineserver output on shutdown listing leaked objects), so the issue is there. I will look why that doesn't happen on thread cleanup though, maybe it should be fixed there indeed. [hookclean.c](/uploads/8a8da3879c58b0d691b4c1ebf90638b4/hookclean.c)