Avoid several null-dereferences of ApiContextRD

This commit is contained in:
Pedro J. Estébanez
2024-01-05 18:27:10 +01:00
parent 13a0d6e9b2
commit d5a5dd52e8
4 changed files with 14 additions and 7 deletions
+2 -1
View File
@@ -6028,10 +6028,11 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
if (context_rd) {
if (context_rd->initialize() != OK) {
ERR_PRINT(vformat("Could not initialize %s", context_rd->get_api_name()));
memdelete(context_rd);
context_rd = nullptr;
r_error = ERR_CANT_CREATE;
ERR_FAIL_MSG(vformat("Could not initialize %s", context_rd->get_api_name()));
return;
}
driver_found = true;
}