Skip to content

Commit

Permalink
fix crashes at start and exit
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitalita committed Sep 30, 2024
1 parent 2f6713d commit 2d97210
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion utility/gdre_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

bool inGuiMode() {
//check if we are in GUI mode
if (GDRESettings::get_singleton() && !GDRESettings::get_singleton()->is_headless()) {
if (GDRESettings::get_singleton() && !GDRESettings::get_singleton()->is_headless() && GodotREEditor::get_singleton()) {
return true;
}
return false;
Expand Down
4 changes: 3 additions & 1 deletion utility/gdre_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ void addCompatibilityClasses() {

GDRESettings::GDRESettings() {
#ifdef TOOLS_ENABLED
RenderingServer::get_singleton()->set_warn_on_surface_upgrade(false);
if (RenderingServer::get_singleton()) {
RenderingServer::get_singleton()->set_warn_on_surface_upgrade(false);
}
#endif
singleton = this;
gdre_packeddata_singleton = memnew(GDREPackedData);
Expand Down

0 comments on commit 2d97210

Please sign in to comment.