From 28639fcae3e5b7221e2a0d49cded93a2523b3632 Mon Sep 17 00:00:00 2001 From: lilu Date: Fri, 16 Aug 2024 23:02:09 +0800 Subject: [PATCH] Delete session operation when life cycle changes --- FastttCamera/FastttCamera.m | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/FastttCamera/FastttCamera.m b/FastttCamera/FastttCamera.m index 3e0cc84..d6a91c0 100644 --- a/FastttCamera/FastttCamera.m +++ b/FastttCamera/FastttCamera.m @@ -161,26 +161,22 @@ - (void)viewDidLayoutSubviews - (void)applicationWillEnterForeground:(NSNotification *)notification { - [self _setupCaptureSession]; + // No need to perform any actions here; frequent session operations can increase the risk of camera freezing. } - (void)applicationDidBecomeActive:(NSNotification *)notification { - if (self.isViewLoaded && self.view.window) { - [self startRunning]; - [self _insertPreviewLayer]; - [self _setPreviewVideoOrientation]; - } + // No need to perform any actions here; frequent session operations can increase the risk of camera freezing. } - (void)applicationWillResignActive:(NSNotification *)notification { - [self stopRunning]; + // No need to perform any actions here; frequent session operations can increase the risk of camera freezing. } - (void)applicationDidEnterBackground:(NSNotification *)notification { - [self _teardownCaptureSession]; + // No need to perform any actions here; frequent session operations can increase the risk of camera freezing. } #pragma mark - Autorotation