OpenCanopy: Statically construct GOP content to match pointer context

This commit is contained in:
Marvin Häuser 2021-03-02 15:31:53 +01:00 committed by Vitaly Cheptsov
parent ed1dcd82a2
commit d339cd2085

View File

@ -48,7 +48,9 @@ GuiOutputConstruct (
VOID
)
{
GUI_OUTPUT_CONTEXT *Context;
// TODO: alloc on the fly?
STATIC GUI_OUTPUT_CONTEXT Context;
EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop;
Gop = InternalGuiOutputLocateGop();
@ -56,13 +58,8 @@ GuiOutputConstruct (
return NULL;
}
Context = AllocatePool (sizeof (*Context));
if (Context == NULL) {
return NULL;
}
Context->Gop = Gop;
return Context;
Context.Gop = Gop;
return &Context;
}
EFI_STATUS
@ -108,5 +105,5 @@ GuiOutputDestruct (
)
{
ASSERT (Context != NULL);
FreePool (Context);
ZeroMem (Context, sizeof (*Context));
}