ソースを参照

Don't try to compare freed object to nullptr

Rafał Mikrut 4 年 前
コミット
2ad5b7100b
1 ファイル変更3 行追加1 行削除
  1. 3 1
      editor/shader_globals_editor.cpp

+ 3 - 1
editor/shader_globals_editor.cpp

@@ -437,6 +437,9 @@ void ShaderGlobalsEditor::_notification(int p_what) {
 			inspector->edit(interface);
 		}
 	}
+	if (p_what == NOTIFICATION_PREDELETE) {
+		inspector->edit(nullptr);
+	}
 }
 
 ShaderGlobalsEditor::ShaderGlobalsEditor() {
@@ -474,6 +477,5 @@ ShaderGlobalsEditor::ShaderGlobalsEditor() {
 }
 
 ShaderGlobalsEditor::~ShaderGlobalsEditor() {
-	inspector->edit(nullptr);
 	memdelete(interface);
 }