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 (#36038)
  • Loading branch information
vivien-apple authored and pull[bot] committed Oct 18, 2024
1 parent eacaa98 commit 5290469
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 5290469

Please sign in to comment.