Fixed memory leak due to forgetting to move initializer code.

This commit is contained in:
Hynak 2022-02-26 19:06:18 -05:00
parent 2d12903185
commit 520ceddf48

View File

@ -37,6 +37,9 @@ void CContext::initializeViewports ()
int fullWidth = DisplayWidth (m_display, DefaultScreen (m_display));
int fullHeight = DisplayHeight (m_display, DefaultScreen (m_display));
m_pm = XCreatePixmap(m_display, DefaultRootWindow(m_display), fullWidth, fullHeight, 24);
m_gc = XCreateGC(m_display, m_pm, 0, NULL);
XRRScreenResources* screenResources = XRRGetScreenResources (m_display, DefaultRootWindow (m_display));
// there are some situations where xrandr returns null (like screen not using the extension)
@ -96,8 +99,6 @@ void CContext::render ()
int fullWidth = DisplayWidth (m_display, DefaultScreen (m_display));
int fullHeight = DisplayHeight (m_display, DefaultScreen (m_display));
m_pm = XCreatePixmap(m_display, root, fullWidth, fullHeight, 24);
m_gc = XCreateGC(m_display, m_pm, 0, NULL);
XFillRectangle(m_display, m_pm, m_gc, 0, 0, fullWidth, fullHeight);
char* image_data;