Commit 1323768
fix: repair three memory issues contributing to animated image leak (#429)
1. elinux_window.h: Fix display refresh rate reported to Flutter engine.
frame_rate_ is in milliHz (e.g. 60000 for a 60 Hz display); dividing
1000000 by it yielded ~16 instead of the required 60 Hz.
FlutterEngineDisplay.refresh_rate expects frames-per-second. Correct
formula is frame_rate_ / 1000.0.
2. elinux_window_wayland.cc: Add missing wl_callback_destroy() when
wp_presentation is available and the done callback returns early.
Without this the client-side wl_proxy object was leaked every time
a new surface frame fires while wp_presentation is active.
3. elinux_egl_surface.cc: Guard PopulateExistingDamage against orphaned
malloc. If the Flutter engine ever calls populate without a subsequent
present_with_info (e.g. at shutdown or on a skipped frame), the
previously allocated FlutterRect buffer is now freed before the new
allocation rather than being silently overwritten.
Fixes: #429
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 1653fa6 commit 1323768
File tree
3 files changed
+11
-1
lines changed- src/flutter/shell/platform/linux_embedded
- surface
- window
3 files changed
+11
-1
lines changedLines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
169 | 178 | | |
170 | 179 | | |
171 | 180 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| |||
0 commit comments