more error checking around images, should prevent vram leaks
Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Waiting to run
ContinuousDelivery / windows (windows-2022, ) (push) Waiting to run
ContinuousDelivery / windows (windows-2022, asan) (push) Waiting to run
ContinuousDelivery / dumpsyms (push) Blocked by required conditions
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / on ubuntu-24.04-arm (push) Waiting to run
ContinuousIntegration / asan on ubuntu-24.04-arm (push) Waiting to run
ContinuousIntegration / on ubuntu-latest (push) Waiting to run
ContinuousIntegration / asan on ubuntu-latest (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run

This commit is contained in:
Green Sky
2025-10-09 18:11:06 +02:00
parent f9667430b9
commit 9e9a270550
2 changed files with 10 additions and 0 deletions

View File

@@ -103,10 +103,17 @@ TextureLoaderResult MessageImageLoader::load(TextureUploaderI& tu, Message3Handl
new_entry.current_texture = 0; new_entry.current_texture = 0;
for (const auto& [ms, data] : res.frames) { for (const auto& [ms, data] : res.frames) {
const auto n_t = tu.upload(data.data(), res.width, res.height); const auto n_t = tu.upload(data.data(), res.width, res.height);
if (n_t == 0) {
continue;
}
new_entry.textures.push_back(n_t); new_entry.textures.push_back(n_t);
new_entry.frame_duration.push_back(ms); new_entry.frame_duration.push_back(ms);
} }
if (new_entry.textures.empty()) {
continue;
}
new_entry.width = res.width; new_entry.width = res.width;
new_entry.height = res.height; new_entry.height = res.height;

View File

@@ -116,6 +116,9 @@ struct TextureCache {
_tu.destroy(tex_id); _tu.destroy(tex_id);
} }
} }
for (const auto& tex_id : _default_texture.textures) {
_tu.destroy(tex_id);
}
} }
struct GetInfo { struct GetInfo {