diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-04-05 09:03:12 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-04-05 09:07:08 -0400 |
| commit | 839fc7e749af9504c6c8ee451c9d47dd32c0dbeb (patch) | |
| tree | 646cfe244980ac195f57897ed4fe9f632d58b00f /Source/Core/DolphinQt2/MainWindow.cpp | |
| parent | d0b7c013a10b4a5fc058245f2051484b4cf55080 (diff) | |
DolphinQt2/MainWindow: Resolve a memory leak on systems with X11
In the case we had X11 libs available, we'd allocate an XRRConfiguration instance and pass it
to the GraphicsWindow instance, but it would never actually be freed.
Diffstat (limited to 'Source/Core/DolphinQt2/MainWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinQt2/MainWindow.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index 3ed8a30729..6d0c452050 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/Source/Core/DolphinQt2/MainWindow.cpp @@ -221,12 +221,11 @@ void MainWindow::CreateComponents() &MemoryWidget::Update); #if defined(HAVE_XRANDR) && HAVE_XRANDR - m_graphics_window = new GraphicsWindow( - new X11Utils::XRRConfiguration( - static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow( - "display", windowHandle())), - winId()), - this); + m_xrr_config = std::make_unique<X11Utils::XRRConfiguration>( + static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow( + "display", windowHandle())), + winId()); + m_graphics_window = new GraphicsWindow(m_xrr_config.get(), this); #else m_graphics_window = new GraphicsWindow(nullptr, this); #endif |
