summaryrefslogtreecommitdiff
path: root/servers/rendering/rendering_server_default.cpp
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2022-05-28 21:09:23 +1000
committerBastiaan Olij <mux213@gmail.com>2022-06-01 20:47:32 +1000
commit69b66ec4254def097fe4e35501a68833bfcee67f (patch)
tree68a1088185fc077fe34080b0e4921da2bfee3e88 /servers/rendering/rendering_server_default.cpp
parent0810b0d4714943d00a28a2b6d1e206a51db6619f (diff)
Ensure has_os_features is safely called as it can't be called from within the construct of RenderingServerDefault on which it relies
Diffstat (limited to 'servers/rendering/rendering_server_default.cpp')
-rw-r--r--servers/rendering/rendering_server_default.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp
index c4538e0776..718f20f80a 100644
--- a/servers/rendering/rendering_server_default.cpp
+++ b/servers/rendering/rendering_server_default.cpp
@@ -313,7 +313,11 @@ RID RenderingServerDefault::get_test_cube() {
}
bool RenderingServerDefault::has_os_feature(const String &p_feature) const {
- return RSG::storage->has_os_feature(p_feature);
+ if (RSG::storage) {
+ return RSG::storage->has_os_feature(p_feature);
+ } else {
+ return false;
+ }
}
void RenderingServerDefault::set_debug_generate_wireframes(bool p_generate) {
@@ -384,6 +388,8 @@ void RenderingServerDefault::draw(bool p_swap_buffers, double frame_step) {
RenderingServerDefault::RenderingServerDefault(bool p_create_thread) :
command_queue(p_create_thread) {
+ RenderingServer::init();
+
create_thread = p_create_thread;
if (!p_create_thread) {