Skip to content

Commit

Permalink
[darwin-framework-tool] Add missing autoreleasepool before checking f…
Browse files Browse the repository at this point in the history
…or leaks
  • Loading branch information
vivien-apple committed Oct 11, 2024
1 parent a76cc9b commit 9dfc039
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/darwin-framework-tool/debug/LeakChecker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ - (BOOL)hasMemoryLeaks
int ConditionalLeaksCheck(int exitCode)
{
#ifdef DFT_ENABLE_LEAK_CHECKING
auto * leakChecker = [[LeakChecker alloc] init];
if ([leakChecker hasMemoryLeaks]) {
return EXIT_FAILURE;
@autoreleasepool {
auto * leakChecker = [[LeakChecker alloc] init];
if ([leakChecker hasMemoryLeaks]) {
return EXIT_FAILURE;
}
}
#endif // DFT_ENABLE_LEAK_CHECKING

Expand Down

0 comments on commit 9dfc039

Please sign in to comment.