gobj: Fix failure to async reload texture more than once

Fixes #1354
This commit is contained in:
rdb 2022-10-28 13:16:07 +02:00
parent 4bdac5afac
commit 54e2ddfd1c

View File

@ -1069,10 +1069,16 @@ async_ensure_ram_image(bool allow_compression, int priority) {
if (delay != 0.0) { if (delay != 0.0) {
Thread::sleep(delay); Thread::sleep(delay);
} }
if (allow_compression) { if (allow_compression) {
get_ram_image(); CDWriter cdata(_cycler, unlocked_ensure_ram_image(true));
} else { cdata->_reload_task = nullptr;
get_uncompressed_ram_image(); do_get_ram_image(cdata);
}
else {
CDWriter cdata(_cycler, false);
cdata->_reload_task = nullptr;
do_get_uncompressed_ram_image(cdata);
} }
return AsyncTask::DS_done; return AsyncTask::DS_done;
}); });