Commit 27e0c81d authored by Michal Malý's avatar Michal Malý Committed by Albert Astals Cid

Do not leak XVisualInfo (X11 EGL path)

Summary: XVisualInfo is not released by get_gl_info_egl

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

Reviewers: graesslin

Reviewed By: graesslin

Subscribers: graesslin, broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6566
parent 3222a95c
......@@ -814,6 +814,7 @@ static QTreeWidgetItem *get_gl_info_egl(Display *dpy, int scrnum, QTreeWidgetIte
if (!ctx) {
qDebug() << "Error: eglCreateContext failed\n";
XDestroyWindow(dpy, win);
XFree(visinfo);
return result;
}
......@@ -822,6 +823,7 @@ static QTreeWidgetItem *get_gl_info_egl(Display *dpy, int scrnum, QTreeWidgetIte
qDebug() << "Error: eglCreateWindowSurface failed\n";
eglDestroyContext(egl_dpy, ctx);
XDestroyWindow(dpy, win);
XFree(visinfo);
return result;
}
......@@ -843,6 +845,7 @@ static QTreeWidgetItem *get_gl_info_egl(Display *dpy, int scrnum, QTreeWidgetIte
eglDestroyContext(egl_dpy, ctx);
eglDestroySurface(egl_dpy, surf);
XDestroyWindow(dpy, win);
XFree(visinfo);
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment