[#26] 배포 connectButton 클릭 시 크래시 해결 #27
Open
+13
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📌 관련 이슈
🥑 작업 요약
🛠️ 작업 내용
View
크래시가 발생한 부분을 확인해보면, 클로저 내에서 메모리 소유권에 대해 모호해지면서 앱이 크래시가 발생하게 됩니다. 이는 Release 최적화 단계에서 View 내부 Task가 생명주기가 잘못 계산되었기 때문입니다.
즉, CodeConnectionView에서
connectButton을 클릭하면 다음 뷰로 넘어가면서 뷰가 사라지니, 클로저에 대한 메모리 소유권이 모호해지게 됩니다.또한, 아키텍쳐 적으로도 View가 비동기 작업임을 모르고 동작이 선언됨만을 ViewController나 ViewModel에 전달하여 비동기 서버 로직을 수행하는 것이 올바른 설계입니다.
따라서,
CodeConnectionView내부의onConnectTap클로저를 동기로 변경하여 문제가 해결될 수 있었습니다.🧪 테스트 방법
✅ 체크리스트