Fix LuaIDE crash at startup caused by missing System Allocator Initialization (#4130)

Signed-off-by: Steve Pham <spham@amazon.com>
monroegm-disable-blank-issue-2
Steve Pham 4 years ago committed by GitHub
parent 77b17846b8
commit dc930a5987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -35,6 +35,10 @@ int main(int argc, char* argv[])
{
AZ::AllocatorInstance<AZ::OSAllocator>::Create();
}
if (!AZ::AllocatorInstance<AZ::SystemAllocator>::IsReady())
{
AZ::AllocatorInstance<AZ::SystemAllocator>::Create();
}
AZStd::unique_ptr<AZ::IO::LocalFileIO> fileIO = AZStd::unique_ptr<AZ::IO::LocalFileIO>(aznew AZ::IO::LocalFileIO());
AZ::IO::FileIOBase::SetInstance(fileIO.get());
@ -70,6 +74,10 @@ int main(int argc, char* argv[])
// if its in GUI mode or not.
}
if (AZ::AllocatorInstance<AZ::SystemAllocator>::IsReady())
{
AZ::AllocatorInstance<AZ::SystemAllocator>::Destroy();
}
if (AZ::AllocatorInstance<AZ::OSAllocator>::IsReady())
{
AZ::AllocatorInstance<AZ::OSAllocator>::Destroy();

Loading…
Cancel
Save