我正在使用Glide加载位图来创建一个gif.
for (int i = 0, count = files.size(); i < count; i++) {
Bitmap img = Glide.with(context)
.load(files.get(i))
.asBitmap()
.centerCrop()
.into(GIF_EXPORT_SIZE / 2, GIF_EXPORT_SIZE / 2)
.get();
// addFrame creates a copy of img, so we can re-use this bitmap
encoder.addFrame(img);
}
Run Code Online (Sandbox Code Playgroud)
我想知道谁负责回收这个Bitmap或者把它放回到Glide BitmapPool中?Glide似乎没有办法自动或通过使用来重复使用它clear().
我看着使用类似的东西直接将Bitmap添加回池中,Glide.get(context).getBitmapPool().put(img)但根据使用BitmapPool的文档直接导致未定义的行为.