-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix WKWebView memory leaks and improve code structure
- Implemented a weak reference to WKWebView in the Coordinator class to prevent strong reference cycles (see Apple Docs on WKWebView: https://developer.apple.com/documentation/webkit/wkwebview). - Added removal of the 'channelClick' message handler in Coordinator's deinit to avoid lingering references in WKUserContentController. - Provided fallback logic when encountering invalid initial URLs, improving overall robustness. - Centered and resized the main window safely, guarding against missing screens. - Added minor logging and placeholders for future expansion, enabling easier debugging in SwiftUI lifecycle. References: - Swift.org Book: Automatic Reference Counting (https://docs.swift.org/swift-book/LanguageGuide/AutomaticReferenceCounting.html) - Instruments Memory Leak Documentation (https://developer.apple.com/documentation/xcode/finding-memory-leaks-using-the-memory-gauge/)
- Loading branch information
Showing
5 changed files
with
94 additions
and
51 deletions.
There are no files selected for viewing
Binary file modified
BIN
+6.32 KB
(120%)
...proj/project.xcworkspace/xcuserdata/nicojaffer.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters