Commit 9c98f86
fix(flutter): Release replay JNI refs on close (#3699)
* fix(flutter): Release replay JNI refs
Release Android replay JNI references when worker isolates shut down
and when replay integration handles are replaced. This prevents replay
bitmap/config/native replay references from being retained after use.
Fixes GH-3633
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* style: Format Dart files
Apply formatter output to touched Dart files so the branch stays clean.
Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(flutter): Avoid replay JNI refs without worker hook
Keep the isolate worker shutdown behavior unchanged and release the replay
integration JNI handle around screenshot recording instead of adding a generic
worker lifecycle callback.
Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* ref(flutter): Use internal logger for JNI paths
Route Android replay and native Java diagnostics through the shared internal
logger instead of the options logging shim.
Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(flutter): Release replay bitmap refs
Create replay bitmaps per capture and release their JNI references after
recording so the replay worker does not retain bitmap handles.
Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* ref(flutter): Simplify replay JNI cleanup
Release the bitmap config reference in the same cleanup block as the other
per-capture JNI references.
Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(flutter): Handle null replay bitmap
Check the generated nullable bitmap creation result before using it so replay
capture avoids a forced unwrap while preserving cleanup of JNI references.
Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* style(flutter): Reorder replay recorder locals
Keep the replay recorder local cleanup variables in use order.
Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(flutter): Clean up cached replay bitmap
Keep the Android replay bitmap cached between same-size captures, but release
it through a replay-specific worker request before the worker shuts down.
Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(flutter): Cache replay integration in worker
Reuse the worker-side replay integration handle during Android replay capture
and release it with the cached bitmap through the replay cleanup request.
Co-Authored-By: GPT-5.5 <noreply@openai.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: GPT-5.5 <noreply@openai.com>1 parent 87fcdd8 commit 9c98f86
6 files changed
Lines changed: 149 additions & 69 deletions
File tree
- packages
- dart/lib/src
- protocol
- telemetry/span
- flutter/lib/src
- native/java
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
424 | | - | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
425 | 426 | | |
426 | 427 | | |
427 | 428 | | |
| |||
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
65 | | - | |
66 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| |||
Lines changed: 95 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
56 | 70 | | |
57 | 71 | | |
58 | 72 | | |
59 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
60 | 76 | | |
61 | 77 | | |
62 | 78 | | |
63 | 79 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
76 | 94 | | |
77 | | - | |
78 | | - | |
| 95 | + | |
79 | 96 | | |
80 | | - | |
| 97 | + | |
81 | 98 | | |
82 | 99 | | |
83 | 100 | | |
| |||
96 | 113 | | |
97 | 114 | | |
98 | 115 | | |
99 | | - | |
| 116 | + | |
100 | 117 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 118 | + | |
105 | 119 | | |
106 | 120 | | |
107 | 121 | | |
108 | 122 | | |
109 | | - | |
| 123 | + | |
| 124 | + | |
110 | 125 | | |
111 | 126 | | |
112 | 127 | | |
113 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
114 | 134 | | |
115 | | - | |
116 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
117 | 138 | | |
118 | 139 | | |
119 | 140 | | |
120 | 141 | | |
121 | 142 | | |
| 143 | + | |
122 | 144 | | |
123 | 145 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
129 | 152 | | |
130 | 153 | | |
131 | 154 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
136 | 171 | | |
137 | 172 | | |
138 | | - | |
| 173 | + | |
139 | 174 | | |
140 | 175 | | |
141 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
142 | 179 | | |
143 | 180 | | |
144 | 181 | | |
145 | | - | |
146 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
147 | 187 | | |
148 | 188 | | |
149 | 189 | | |
150 | 190 | | |
151 | 191 | | |
| 192 | + | |
152 | 193 | | |
153 | 194 | | |
154 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
155 | 211 | | |
156 | 212 | | |
157 | 213 | | |
| |||
Lines changed: 24 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
| |||
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
94 | | - | |
95 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
96 | 105 | | |
97 | 106 | | |
98 | 107 | | |
| |||
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
130 | | - | |
131 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
132 | 144 | | |
133 | 145 | | |
134 | 146 | | |
| |||
187 | 199 | | |
188 | 200 | | |
189 | 201 | | |
190 | | - | |
| 202 | + | |
191 | 203 | | |
192 | 204 | | |
193 | 205 | | |
| |||
335 | 347 | | |
336 | 348 | | |
337 | 349 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
345 | 357 | | |
346 | 358 | | |
347 | 359 | | |
| |||
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
236 | 238 | | |
237 | 239 | | |
238 | 240 | | |
| 241 | + | |
| 242 | + | |
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
242 | | - | |
| 246 | + | |
243 | 247 | | |
244 | 248 | | |
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
248 | | - | |
249 | | - | |
| 252 | + | |
250 | 253 | | |
251 | 254 | | |
252 | 255 | | |
| |||
0 commit comments