Valgrind reports that KWindowSystem leaks memory: ==20597== 2,562 (104 direct, 2,458 indirect) bytes in 1 blocks are definitely lost in loss record 954 of 983 ==20597== at 0x4C2BC97: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==20597== by 0x65D5AC9: KWindowSystem::init(int) (kwindowsystem_x11.cpp:408) ==20597== by 0x65D6029: KWindowSystem::compositingActive() (kwindowsystem_x11.cpp:797) ==20597== by 0x1CB37E08: ??? (in /usr/lib64/libkonsoleprivate.so) ==20597== by 0x400E7B5: call_init (in /lib64/ld-2.15.so) ==20597== by 0x400E899: _dl_init (in /lib64/ld-2.15.so) ==20597== by 0x4012A68: dl_open_worker (in /lib64/ld-2.15.so) ==20597== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so) ==20597== by 0x401228B: _dl_open (in /lib64/ld-2.15.so) ==20597== by 0xDFC7015: dlopen_doit (in /lib64/libdl-2.15.so) ==20597== by 0x400E5F5: _dl_catch_error (in /lib64/ld-2.15.so) ==20597== by 0xDFC75EB: _dlerror_run (in /lib64/libdl-2.15.so) It seems to me that adding a destructor to KWindowSystemStaticContainer that deletes d would fix this issue, however I am very unfamiliar with that code, so I won't commit that change. Not an important leak since it is a global static, but it would reduce valgrinds output
Got fixed by using std::unique_ptr<KWindowSystemPrivate> d;