Skip to content

Commit

Permalink
fix(jsc): fix ios c autorelease
Browse files Browse the repository at this point in the history
  • Loading branch information
etkmao committed Jan 2, 2025
1 parent dca3105 commit 2d167a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/footstone/src/platform/ios/looper_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ static constexpr CFTimeInterval kInterval = IOS_WORKER_TIME_INTERVAL;
static constexpr CFTimeInterval kInterval = 1.0e10;
#endif

extern "C" void * objc_autoreleasePoolPush(void);
extern "C" void objc_autoreleasePoolPop(void *);

static void OnTimerCb(CFRunLoopTimerRef timer, LooperDriver* driver) {
FOOTSTONE_DCHECK(driver);
driver->OnTimerFire(timer);
Expand Down Expand Up @@ -88,7 +91,9 @@ void LooperDriver::OnTimerFire(CFRunLoopTimerRef timer) {
if (IsExitImmediately()) {
return;
}
auto obj = objc_autoreleasePoolPush();
unit_();
objc_autoreleasePoolPop(obj);
}

}
Expand Down

0 comments on commit 2d167a4

Please sign in to comment.