Fix critical memory leaks identified in architecture review: Add signal handler disconnection in WebKitNative (load-changed and script-dialog signals now properly cleaned up), implement GTK idle callback cleanup with automatic removal on completion, add dlclose() calls for WebKit library handles, track GTK signal IDs in GtkSkiaSurfaceWidget for proper disposal. Replace empty catch blocks in GestureManager with logged exception handling. Add WebKitNative.Cleanup() and GtkNative.ClearCallbacks() methods for application shutdown.
Replace 495+ Console.WriteLine debug statements across handlers, dispatching, services, views, and window components with centralized DiagnosticLog service for proper logging infrastructure. Add new DiagnosticLog.cs service with Debug/Error methods to eliminate debug logging pollution in production code.
Incomplete functionality fixes:
- SkiaEditor: Wire up Completed event to fire on focus lost
- X11InputMethodService: Remove unused _commitCallback field
- SkiaWebView: Set _isProperlyReparented when reparenting succeeds,
use _lastMainX/_lastMainY to track main window position,
add _isEmbedded guard to prevent double embedding
Nullable reference fixes:
- Easing: Reorder BounceOut before BounceIn (static init order)
- GestureManager: Use local command variable instead of re-accessing
- SkiaShell: Handle null Title with ?? operator
- GLibNative: Use null! for closure pattern
- LinuxProgramHost: Default title if null
- SkiaWebView.LoadHtml: Add null/empty check for html
- SystemThemeService: Initialize Colors with default values
- DeviceDisplayService/AppInfoService: Use var for nullable env vars
- EmailService: Add null check for message parameter
Async fixes:
- SkiaImage: Use _ = for fire-and-forget async calls
- SystemTrayService: Convert async method without await to sync Task
Reduces warnings from 156 to 133 (remaining are P/Invoke structs
and obsolete MAUI API usage)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GestureManager.cs:
- Added third fallback for TappedEvent fields (_TappedHandler, <Tapped>k__BackingField)
- Added type info dump when event cannot be fired (debugging aid)
- Fixed swipe Right handling with proper direction check
- Added SendSwiped success log
- Changed Has* methods to use foreach instead of LINQ
CollectionViewHandler.cs:
- Added full OnItemTapped implementation with gesture handling
- Added MauiView assignment in MapItemTemplate for gesture processing
SkiaItemsView.cs:
- Added GetItemView() method for CollectionViewHandler
Verified handlers match decompiled:
- GraphicsViewHandler
- ItemsViewHandler
- WindowHandler
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>