Fix uninitialized AbstractScreen instance pointer.

...yeah yeah, one day I'm gonna zero out the kernel's BSS segment. Soon..
This commit is contained in:
Andreas Kling 2019-01-11 01:43:41 +01:00
parent f6d2c3ed87
commit d1ceb4b603
3 changed files with 8 additions and 0 deletions

View file

@ -13,6 +13,7 @@ void WindowComposer_main()
FrameBuffer::initialize();
EventLoop::initialize();
WindowManager::initialize();
AbstractScreen::initialize();
auto info = current->get_display_info();

View file

@ -6,6 +6,11 @@
static AbstractScreen* s_the;
void AbstractScreen::initialize()
{
s_the = nullptr;
}
AbstractScreen& AbstractScreen::the()
{
ASSERT(s_the);

View file

@ -16,6 +16,8 @@ public:
Size size() const { return { width(), height() }; }
Rect rect() const { return { 0, 0, width(), height() }; }
static void initialize();
protected:
AbstractScreen(unsigned width, unsigned height);