Commit 67fa2f8
committed
fix(notification): fix memory leak in NotifyServerApplet destructor
Fixed the issue where NotificationManager was not properly destroyed
when the worker thread exited. The deleteLater() call was scheduled
but never executed because the thread's event loop had already stopped.
Added comprehensive unit tests to verify the fix covers all destruction
scenarios including worker-only, manager-only, and both present cases.
Log: Fix memory leak in NotifyServerApplet destructor
fix(notification): 修复 NotifyServerApplet 析构函数中的内存泄漏
修复了当工作线程退出时 NotificationManager 未被正确销毁的问题。
deleteLater() 被调度但从未执行,因为线程的事件循环已经停止。
添加了全面的单元测试来验证修复涵盖了所有销毁场景,
包括仅 worker、仅 manager 和两者都存在的情况。
Log: 修复 NotifyServerApplet 析构函数中的内存泄漏1 parent dfa6319 commit 67fa2f8
3 files changed
Lines changed: 287 additions & 17 deletions
File tree
- panels/notification/server
- tests/panels/notification/server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
35 | 61 | | |
36 | 62 | | |
37 | 63 | | |
| |||
42 | 68 | | |
43 | 69 | | |
44 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
45 | 77 | | |
46 | 78 | | |
47 | 79 | | |
48 | 80 | | |
49 | 81 | | |
50 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
51 | 87 | | |
52 | 88 | | |
53 | 89 | | |
| |||
60 | 96 | | |
61 | 97 | | |
62 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
63 | 104 | | |
64 | 105 | | |
65 | 106 | | |
66 | 107 | | |
67 | 108 | | |
68 | 109 | | |
| 110 | + | |
69 | 111 | | |
70 | 112 | | |
71 | 113 | | |
72 | 114 | | |
73 | 115 | | |
| 116 | + | |
74 | 117 | | |
75 | 118 | | |
76 | 119 | | |
77 | 120 | | |
78 | 121 | | |
| 122 | + | |
79 | 123 | | |
80 | 124 | | |
81 | 125 | | |
82 | 126 | | |
83 | 127 | | |
| 128 | + | |
84 | 129 | | |
85 | 130 | | |
86 | 131 | | |
87 | 132 | | |
88 | 133 | | |
| 134 | + | |
89 | 135 | | |
90 | 136 | | |
91 | 137 | | |
92 | 138 | | |
93 | 139 | | |
| 140 | + | |
94 | 141 | | |
95 | 142 | | |
96 | 143 | | |
97 | 144 | | |
98 | 145 | | |
| 146 | + | |
99 | 147 | | |
100 | 148 | | |
101 | 149 | | |
102 | 150 | | |
103 | 151 | | |
| 152 | + | |
104 | 153 | | |
105 | 154 | | |
106 | 155 | | |
107 | 156 | | |
108 | 157 | | |
| 158 | + | |
109 | 159 | | |
110 | 160 | | |
111 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
9 | 25 | | |
10 | 26 | | |
11 | 27 | | |
| |||
34 | 50 | | |
35 | 51 | | |
36 | 52 | | |
37 | | - | |
38 | | - | |
| 53 | + | |
| 54 | + | |
39 | 55 | | |
40 | 56 | | |
41 | 57 | | |
0 commit comments