You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# [CRITICAL] Fix memory leak in RouteViewHost - Event handler not unsubscribed
2
+
3
+
## Priority: CRITICAL 🔴
4
+
5
+
## Location
6
+
`SimpleRouter.Avalonia/RouteViewHost.cs:30`
7
+
8
+
## Issue Description
9
+
Event handler is subscribed to the router's `OnRouteChanged` event but never unsubscribed when the Router changes or the control is disposed. This causes a memory leak in applications with dynamic router changes.
10
+
11
+
**Current Code:**
12
+
```csharp
13
+
router.OnRouteChanged += Router_OnRouteChanged;
14
+
```
15
+
16
+
## Impact
17
+
- Memory leaks in applications with dynamic router changes
18
+
- Event handlers remain in memory even after the control is disposed
19
+
- Can lead to increased memory consumption over time
0 commit comments