mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
[MA-225][DNO-95] remove message loop handlers when destroying VulkanSurfaceProducer to avoid callbacks on deleted pointers (#3733)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user