Merge pull request #46399 from YeldhamDev/import_defaults_another_fix
Fix heap-use-after-free in Import Defaults Editor
This commit is contained in:
commit
369dffc217
3 changed files with 7 additions and 4 deletions
|
@ -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