Fix huge memory allocation on unused emoji.

Before that change call to Instance::setColored started emoji loading
and allocating memory for all animation frames even if it wasn't used.
This commit is contained in:
John Preston 2023-03-09 09:43:13 +04:00
parent 2996fb7030
commit 03f8127875

View file

@ -706,7 +706,9 @@ bool Instance::ready() {
if (state.hasImagePreview()) {
return true;
}
load(state);
if (!_usage.empty()) {
load(state);
}
return false;
}, [](Caching &state) {
return state.renderer->canMakePreview();