Do not leak XVisualInfo (X11 EGL path)
ClosedPublic

Authored by madcatx on Jul 8 2017, 11:05 AM.

Details

Summary

XVisualInfo is not released by get_gl_info_egl

Test Plan

Leak check with valgrind shows that visinfo is no longer leaking.

Diff Detail

Repository
R102 KInfoCenter
Lint
Lint Skipped
Unit
Unit Tests Skipped
madcatx created this revision.Jul 8 2017, 11:05 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 8 2017, 11:05 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

Would it make sense to wrap that in a QScopedPointer with a custom deleter that calls XFree? This way one does not need to remember calling it whenever the function is exited.

graesslin accepted this revision.Jul 8 2017, 12:57 PM
graesslin added a subscriber: graesslin.

An alternative could be to use QScopedPointer or std::unique_ptr with XFree as the deleter.

This revision is now accepted and ready to land.Jul 8 2017, 12:57 PM
aacid closed this revision.Sep 5 2017, 8:26 PM