From f48feae0b2a300992479abf0b2ded85e45ac6045 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Aug 2020 09:36:06 -0600 Subject: Kernel: Switch singletons to use new Singleton class Fixes #3226 --- Kernel/Devices/BXVGADevice.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Kernel/Devices/BXVGADevice.cpp') diff --git a/Kernel/Devices/BXVGADevice.cpp b/Kernel/Devices/BXVGADevice.cpp index 1e3a4b5168..c31e6ec1f1 100644 --- a/Kernel/Devices/BXVGADevice.cpp +++ b/Kernel/Devices/BXVGADevice.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -56,7 +57,12 @@ namespace Kernel { #define VBE_DISPI_ENABLED 0x01 #define VBE_DISPI_LFB_ENABLED 0x40 -static BXVGADevice* s_the; +static auto s_the = make_singleton(); + +void BXVGADevice::initialize() +{ + s_the.ensure_instance(); +} BXVGADevice& BXVGADevice::the() { @@ -67,7 +73,6 @@ BXVGADevice::BXVGADevice() : BlockDevice(29, 0) { - s_the = this; m_framebuffer_address = PhysicalAddress(find_framebuffer_address()); set_safe_resolution(); } -- cgit v1.2.3