render: Bail on attempts on panicking recursive render. (#8248)

This commit is contained in:
Adrian Wielgosik 2022-10-09 21:33:57 +02:00 committed by GitHub
parent 84533e278d
commit 10c19fef57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -297,7 +297,11 @@ impl<'gc> TDisplayObject<'gc> for Bitmap<'gc> {
let bitmap_data = self.0.read();
if let Some(bitmap_handle) = bitmap_data.bitmap_handle {
if let Some(inner_bitmap_data) = bitmap_data.bitmap_data {
let bd = inner_bitmap_data.read();
let bd = if let Ok(bd) = inner_bitmap_data.try_read() {
bd
} else {
return; // bail, this is caused by recursive render attempt. TODO: support this.
};
if bd.dirty() {
if let Err(e) = context.renderer.update_texture(
bitmap_handle,