Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3749980

Browse files
[Impeller] Ensure that the auto-release pool is available when the GoldenPlaygroundTestImpl is destructed (#43322)
1 parent 8e6382d commit 3749980

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

impeller/golden_tests/golden_playground_test.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ class GoldenPlaygroundTest
5252
ISize GetWindowSize() const;
5353

5454
private:
55-
struct GoldenPlaygroundTestImpl;
56-
// This is only a shared_ptr so it can work with a forward declared type.
57-
std::shared_ptr<GoldenPlaygroundTestImpl> pimpl_;
58-
5955
#if FML_OS_MACOSX
56+
// This must be placed first so that the autorelease pool is not destroyed
57+
// until the GoldenPlaygroundTestImpl has been destructed.
6058
fml::ScopedNSAutoreleasePool autorelease_pool_;
6159
#endif
6260

61+
struct GoldenPlaygroundTestImpl;
62+
// This is only a shared_ptr so it can work with a forward declared type.
63+
std::shared_ptr<GoldenPlaygroundTestImpl> pimpl_;
64+
6365
FML_DISALLOW_COPY_AND_ASSIGN(GoldenPlaygroundTest);
6466
};
6567

0 commit comments

Comments
 (0)