From 744940ffd595651976e5e3bedce5bc0941260488 Mon Sep 17 00:00:00 2001 From: hemirt Date: Fri, 14 Apr 2017 14:08:57 +0200 Subject: [PATCH] windowmanager destructor free _mainwindow, fix save - remove const in (#36) * windowmanager destructor free _mainwindow, fix save - remove const in settingsPath that is being written to from ptree tree * syntax error * remove destructor, singleton, let OS claim the resource as no special cleanup of _mainWindow is not needed --- messages/messagebuilder.h | 1 + platform/borderless/winnativewindow.h | 1 + usermanager.h | 1 + widgets/mainwindow.cpp | 1 + windowmanager.cpp | 5 ++--- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/messages/messagebuilder.h b/messages/messagebuilder.h index 5ec2e0953..f6c38b06a 100644 --- a/messages/messagebuilder.h +++ b/messages/messagebuilder.h @@ -2,6 +2,7 @@ #define MESSAGEBUILDER_H #include "messages/message.h" +#include namespace chatterino { namespace messages { diff --git a/platform/borderless/winnativewindow.h b/platform/borderless/winnativewindow.h index accb97505..3600a8817 100644 --- a/platform/borderless/winnativewindow.h +++ b/platform/borderless/winnativewindow.h @@ -1,6 +1,7 @@ #ifndef WINNATIVEWINDOW_H #define WINNATIVEWINDOW_H +#define NOMINMAX #include "Windows.h" #include "Windowsx.h" diff --git a/usermanager.h b/usermanager.h index d2a3dedd9..cb3dab6d5 100644 --- a/usermanager.h +++ b/usermanager.h @@ -4,6 +4,7 @@ #include "twitch/twitchuser.h" #include +#include namespace chatterino { diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 1a5061162..3e003b0de 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -10,6 +10,7 @@ #include #ifdef USEWINSDK +#define NOMINMAX #include "Windows.h" #endif diff --git a/windowmanager.cpp b/windowmanager.cpp index da8828143..8aa2a7b62 100644 --- a/windowmanager.cpp +++ b/windowmanager.cpp @@ -10,8 +10,7 @@ namespace chatterino { WindowManager WindowManager::instance; WindowManager::WindowManager() - : _windowMutex() - , _mainWindow(nullptr) + : _mainWindow(nullptr) { } @@ -103,7 +102,7 @@ void WindowManager::load() void WindowManager::save() { - const auto &settingsPath = getSettingsPath(); + auto &settingsPath = getSettingsPath(); boost::property_tree::ptree tree; // Create windows array