File tree 1 file changed +4
-0
lines changed
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ pub struct Image {
124
124
pub ( crate ) is_svg : bool ,
125
125
pub ( crate ) color_space : ColorSpace ,
126
126
pub ( crate ) src : Option < Either < Uint8Array , String > > ,
127
+ // take ownership of avif image, let it be dropped when image is dropped
128
+ _avif_image_ref : Option < AvifImage > ,
127
129
}
128
130
129
131
impl ObjectFinalize for Image {
@@ -154,6 +156,7 @@ impl Image {
154
156
is_svg : false ,
155
157
color_space,
156
158
src : None ,
159
+ _avif_image_ref : None ,
157
160
} )
158
161
}
159
162
@@ -501,6 +504,7 @@ impl Task for BitmapDecoder {
501
504
self_mut. src = self . data . take ( ) ;
502
505
self_mut. is_svg = bitmap. is_svg ;
503
506
self_mut. bitmap = Some ( bitmap. data ) ;
507
+ self_mut. _avif_image_ref = bitmap. decoded_image ;
504
508
env. adjust_external_memory ( ( output. width as i64 ) * ( output. height as i64 ) * 4 ) ?;
505
509
}
506
510
DecodeStatus :: Empty => { }
You can’t perform that action at this time.
0 commit comments