Bug 313598 - KWindowSystem leaks memory
Summary: KWindowSystem leaks memory
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: kdeui (show other bugs)
Version: 4.9.97 RC2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-21 00:30 UTC by Alex Richardson
Modified: 2024-05-10 22:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Richardson 2013-01-21 00:30:21 UTC
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
Comment 1 Christoph Cullmann 2024-05-10 22:16:26 UTC
Got fixed by using

std::unique_ptr<KWindowSystemPrivate> d;