[Impeller] Ensure that the auto-release pool is available when the GoldenPlaygroundTestImpl is destructed (flutter/engine#43322)

This commit is contained in:
Jason Simmons
2023-06-29 09:33:26 -07:00
committed by GitHub
parent d69d614045
commit 0f55317632

View File

@@ -52,14 +52,16 @@ class GoldenPlaygroundTest
ISize GetWindowSize() const;
private:
#if FML_OS_MACOSX
// This must be placed first so that the autorelease pool is not destroyed
// until the GoldenPlaygroundTestImpl has been destructed.
fml::ScopedNSAutoreleasePool autorelease_pool_;
#endif
struct GoldenPlaygroundTestImpl;
// This is only a shared_ptr so it can work with a forward declared type.
std::shared_ptr<GoldenPlaygroundTestImpl> pimpl_;
#if FML_OS_MACOSX
fml::ScopedNSAutoreleasePool autorelease_pool_;
#endif
FML_DISALLOW_COPY_AND_ASSIGN(GoldenPlaygroundTest);
};