mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 07:45:33 +01:00
Merge pull request #6600 from lioncash/leak
DolphinQt2/MainWindow: Resolve a memory leak on systems with X11
This commit is contained in:
commit
a66c7d6a64
@ -221,12 +221,11 @@ void MainWindow::CreateComponents()
|
|||||||
&MemoryWidget::Update);
|
&MemoryWidget::Update);
|
||||||
|
|
||||||
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||||
m_graphics_window = new GraphicsWindow(
|
m_xrr_config = std::make_unique<X11Utils::XRRConfiguration>(
|
||||||
new X11Utils::XRRConfiguration(
|
static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow(
|
||||||
static_cast<Display*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow(
|
"display", windowHandle())),
|
||||||
"display", windowHandle())),
|
winId());
|
||||||
winId()),
|
m_graphics_window = new GraphicsWindow(m_xrr_config.get(), this);
|
||||||
this);
|
|
||||||
#else
|
#else
|
||||||
m_graphics_window = new GraphicsWindow(nullptr, this);
|
m_graphics_window = new GraphicsWindow(nullptr, this);
|
||||||
#endif
|
#endif
|
||||||
|
@ -43,6 +43,11 @@ class SettingsWindow;
|
|||||||
class WatchWidget;
|
class WatchWidget;
|
||||||
class WiiTASInputWindow;
|
class WiiTASInputWindow;
|
||||||
|
|
||||||
|
namespace X11Utils
|
||||||
|
{
|
||||||
|
class XRRConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
class MainWindow final : public QMainWindow
|
class MainWindow final : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -146,6 +151,10 @@ private:
|
|||||||
void dropEvent(QDropEvent* event) override;
|
void dropEvent(QDropEvent* event) override;
|
||||||
QSize sizeHint() const override;
|
QSize sizeHint() const override;
|
||||||
|
|
||||||
|
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||||
|
std::unique_ptr<X11Utils::XRRConfiguration> m_xrr_config;
|
||||||
|
#endif
|
||||||
|
|
||||||
QProgressDialog* m_progress_dialog = nullptr;
|
QProgressDialog* m_progress_dialog = nullptr;
|
||||||
QStackedWidget* m_stack;
|
QStackedWidget* m_stack;
|
||||||
ToolBar* m_tool_bar;
|
ToolBar* m_tool_bar;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user