提交 e954e2f6 编写于 作者: F freiling 提交者: GitHub

[MA-225][DNO-95] remove message loop handlers when destroying...

[MA-225][DNO-95] remove message loop handlers when destroying VulkanSurfaceProducer to avoid callbacks on deleted pointers (#3733)
上级 bd09286e
......@@ -52,6 +52,12 @@ VulkanRasterizer::VulkanSurfaceProducer::VulkanSurfaceProducer() {
FTL_LOG(ERROR) << "VulkanSurfaceProducer failed to initialize";
}
VulkanRasterizer::VulkanSurfaceProducer::~VulkanSurfaceProducer() {
for (auto &surface_info : pending_surfaces_)
mtl::MessageLoop::GetCurrent()->RemoveHandler(
surface_info.second.handler_key);
}
std::unique_ptr<VulkanRasterizer::VulkanSurfaceProducer::Surface>
VulkanRasterizer::VulkanSurfaceProducer::CreateSurface(uint32_t width,
uint32_t height) {
......
......@@ -39,6 +39,7 @@ class VulkanRasterizer : public Rasterizer {
private mtl::MessageLoopHandler {
public:
VulkanSurfaceProducer();
~VulkanSurfaceProducer() override;
sk_sp<SkSurface> ProduceSurface(SkISize size,
mozart::ImagePtr* out_image) override;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册