Skip to content

Commit 21a6bd8

Browse files
committed
Merge pull request godotengine#101182 from stuartcarnie/editor_crash_import
Editor: Fix crash when using `--import --verbose` due to use-after-free
2 parents 52f542b + 501fc1a commit 21a6bd8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

editor/editor_resource_preview.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,14 @@ void EditorResourcePreview::_bind_methods() {
522522
ADD_SIGNAL(MethodInfo("preview_invalidated", PropertyInfo(Variant::STRING, "path")));
523523
}
524524

525+
void EditorResourcePreview::_notification(int p_what) {
526+
switch (p_what) {
527+
case NOTIFICATION_EXIT_TREE: {
528+
stop();
529+
} break;
530+
}
531+
}
532+
525533
void EditorResourcePreview::check_for_invalidation(const String &p_path) {
526534
bool call_invalidated = false;
527535
{

editor/editor_resource_preview.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class EditorResourcePreview : public Node {
123123
void _update_thumbnail_sizes();
124124

125125
protected:
126+
void _notification(int p_what);
126127
static void _bind_methods();
127128

128129
public:

0 commit comments

Comments
 (0)