mirror of
https://github.com/godotengine/godot
synced 2024-09-06 02:28:49 +00:00
Fix heap-use-after-free in Import Defaults Editor
This commit is contained in:
parent
58cb152565
commit
f2ad7c5f12
|
@ -69,6 +69,12 @@ protected:
|
|||
}
|
||||
};
|
||||
|
||||
void ImportDefaultsEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_PREDELETE) {
|
||||
inspector->edit(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void ImportDefaultsEditor::_reset() {
|
||||
if (settings->importer.is_valid()) {
|
||||
settings->values = settings->default_values;
|
||||
|
@ -206,6 +212,5 @@ ImportDefaultsEditor::ImportDefaultsEditor() {
|
|||
}
|
||||
|
||||
ImportDefaultsEditor::~ImportDefaultsEditor() {
|
||||
inspector->edit(nullptr);
|
||||
memdelete(settings);
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ class ImportDefaultsEditor : public VBoxContainer {
|
|||
void _save();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
|
||||
public:
|
||||
|
|
|
@ -483,8 +483,5 @@ ShaderGlobalsEditor::ShaderGlobalsEditor() {
|
|||
}
|
||||
|
||||
ShaderGlobalsEditor::~ShaderGlobalsEditor() {
|
||||
if (is_visible_in_tree()) {
|
||||
inspector->edit(nullptr);
|
||||
}
|
||||
memdelete(interface);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue