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();
}
}
}