From 6b7fe4c8f27fc6ad4e454269c43ba0de703b8919 Mon Sep 17 00:00:00 2001 From: Norman Heino Date: Sun, 26 May 2019 17:18:42 +0200 Subject: [PATCH 1/2] Fix use-after-free in Profile::UnloadMachineData --- oscar/SleepLib/profiles.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/oscar/SleepLib/profiles.cpp b/oscar/SleepLib/profiles.cpp index bf5c3c15..48e7178d 100644 --- a/oscar/SleepLib/profiles.cpp +++ b/oscar/SleepLib/profiles.cpp @@ -581,16 +581,17 @@ void Profile::UnloadMachineData() return; } - for (auto & day : daylist) { - delete day; - } - daylist.clear(); - for (auto & mach : m_machlist) { mach->saveSessionInfo(); mach->sessionlist.clear(); mach->day.clear(); } + + for (auto & day : daylist) { + delete day; + } + daylist.clear(); + removeLock(); } void Profile::LoadMachineData(ProgressDialog *progress) From d2eccabbc728da3a3650b3bfbb06826685695f79 Mon Sep 17 00:00:00 2001 From: Norman Heino Date: Mon, 27 May 2019 05:49:03 +0200 Subject: [PATCH 2/2] Fix disabling dark mode on macOS Mojave --- Building/MacOS/Info.plist.in | 34 +++++++++++++++++----------------- OSCAR_QT.pro | 4 ---- oscar/oscar.pro | 4 ++++ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Building/MacOS/Info.plist.in b/Building/MacOS/Info.plist.in index 2d2b4a72..407b487a 100644 --- a/Building/MacOS/Info.plist.in +++ b/Building/MacOS/Info.plist.in @@ -2,25 +2,25 @@ - CFBundleExecutable - OSCAR - CFBundleGetInfoString - Created by Qt/QMake - CFBundleIconFile + CFBundleExecutable + OSCAR + CFBundleGetInfoString + Created by Qt/QMake + CFBundleIconFile ${ASSETCATALOG_COMPILER_APPICON_NAME} - CFBundleIdentifier + CFBundleIdentifier ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundlePackageType - APPL - CFBundleSignature - ???? - LSMinimumSystemVersion + CFBundlePackageType + APPL + CFBundleSignature + ???? + LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} - NSPrincipalClass - NSApplication - NSSupportsAutomaticGraphicsSwitching - - NSRequiresAquaSystemAppearance - + NSPrincipalClass + NSApplication + NSSupportsAutomaticGraphicsSwitching + + NSRequiresAquaSystemAppearance + diff --git a/OSCAR_QT.pro b/OSCAR_QT.pro index 6a8c3dbb..df4e72bb 100644 --- a/OSCAR_QT.pro +++ b/OSCAR_QT.pro @@ -10,7 +10,3 @@ TEMPLATE = subdirs SUBDIRS += oscar CONFIG += ordered - -macx: { - QMAKE_INFO_PLIST = Building/MacOS/Info.plist.in -} diff --git a/oscar/oscar.pro b/oscar/oscar.pro index de7129bb..a881bbaa 100644 --- a/oscar/oscar.pro +++ b/oscar/oscar.pro @@ -457,3 +457,7 @@ test { tests/sessiontests.h } +# On macOS put a custom Info.plist into the bundle that disables dark mode on Mojave +macx { + QMAKE_INFO_PLIST = "../Building/MacOS/Info.plist.in" +}