Commit fb435de
Ubuntu
fix: set surface event AFTER SetFormat to preserve draw thread invariant
Review feedback: setting surfaceEvent before SetFormat is dangerous because
the draw thread can get a stale surface pointer that's being torn down.
New approach: Set surfaceEvent AFTER SetFormat returns. By this point, the
synchronous SurfaceDestroyed→SurfaceCreated→SurfaceChanged cycle has already
completed and surfaceGlobalRef points to the new RGBA8888 surface. This
preserves the invariant that surfaceEvent is only set when surfaceGlobalRef
points to a safe-to-render surface.
The NativeWatchdog.Heartbeat() is still called before SetFormat to reset the
watchdog timer during the blocking teardown.1 parent 2dd8eeb commit fb435de
1 file changed
Lines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | 903 | | |
912 | 904 | | |
913 | 905 | | |
| |||
935 | 927 | | |
936 | 928 | | |
937 | 929 | | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
| |||
0 commit comments