From 83fcb6c2493710e29cb027ae8f7b4e36e797a5da Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Sat, 12 Oct 2019 12:11:28 -0700 Subject: [PATCH] Fix the crashing Selection test --- src/host/selection.cpp | 7 +------ src/host/selection.hpp | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/host/selection.cpp b/src/host/selection.cpp index 5a361595f6..9db5abca58 100644 --- a/src/host/selection.cpp +++ b/src/host/selection.cpp @@ -12,8 +12,6 @@ using namespace Microsoft::Console::Interactivity; using namespace Microsoft::Console::Types; -std::unique_ptr Selection::_instance; - Selection::Selection() : _fSelectionVisible(false), _ulSavedCursorSize(0), @@ -32,10 +30,7 @@ Selection::Selection() : Selection& Selection::Instance() { - if (!_instance) - { - _instance.reset(new Selection()); - } + static std::unique_ptr _instance{ new Selection() }; return *_instance; } diff --git a/src/host/selection.hpp b/src/host/selection.hpp index 1d8733479b..76a241950d 100644 --- a/src/host/selection.hpp +++ b/src/host/selection.hpp @@ -84,8 +84,6 @@ private: void _CancelMarkSelection(); void _CancelMouseSelection(); - static std::unique_ptr _instance; - // ------------------------------------------------------------------------------------------------------- // input handling (selectionInput.cpp) public: