1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Memory leak and crash fixes

This commit is contained in:
Rafał Mikrut
2019-11-10 09:49:13 +01:00
parent 4569f5ec82
commit 7dda9309f9
10 changed files with 24 additions and 4 deletions

View File

@@ -103,9 +103,11 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2
img = ltex->to_image();
} else {
Ref<Texture> tex = p_from;
img = tex->get_data();
if (img.is_valid()) {
img = img->duplicate();
if (tex.is_valid()) {
img = tex->get_data();
if (img.is_valid()) {
img = img->duplicate();
}
}
}