Do not leak XVisualInfo (X11 EGL path)

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



XVisualInfo is not released by get_gl_info_egl

Test Plan

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

Diff Detail

R102 KInfoCenter
Lint Skipped
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