mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Early out when context creation fails
This commit is contained in:
@@ -469,8 +469,12 @@ int32_t cmdline_for_screenshot(const char** argv, int32_t argc, ScreenshotOption
|
|||||||
|
|
||||||
gOpenRCT2Headless = true;
|
gOpenRCT2Headless = true;
|
||||||
auto context = CreateContext();
|
auto context = CreateContext();
|
||||||
if (context->Initialise())
|
if (!context->Initialise())
|
||||||
{
|
{
|
||||||
|
std::puts("Failed to initialize context.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
drawing_engine_init();
|
drawing_engine_init();
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -602,6 +606,6 @@ int32_t cmdline_for_screenshot(const char** argv, int32_t argc, ScreenshotOption
|
|||||||
|
|
||||||
free(dpi.bits);
|
free(dpi.bits);
|
||||||
drawing_engine_dispose();
|
drawing_engine_dispose();
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user