Memory leak and crash fixes
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user