fix imageview::setImageBitmap's crash in multi calls

This commit is contained in:
houzh 2023-11-20 09:24:07 +08:00
parent d84de8e99e
commit a04c87ae0d

View File

@ -720,7 +720,8 @@ void ImageView::updateDrawable(Drawable*d){
}
void ImageView::setImageBitmap(RefPtr<ImageSurface>bitmap){
delete mDrawable;
if(mDrawable!=mRecycleableBitmapDrawable)
delete mDrawable;
mDrawable = nullptr;
if (mRecycleableBitmapDrawable == nullptr) {
mRecycleableBitmapDrawable = new BitmapDrawable(bitmap);