Commit 63c3c01
committed
terminal: Correct logic error in supervisor_start_terminal
If `supervisor_start_terminal` is called twice in a row without
`supervisor_stop_terminal`, it would lose track of a supervisor
allocation.
This can occur when setting the rotation of a display, including the
way that a FramebufferDisplay sets rotation _AFTER_ initial construction,
first with a stack like
```
#0 supervisor_start_terminal
#1 in displayio_display_core_construct
#2 in common_hal_framebufferio_framebufferdisplay_construct
```
and then with a stack like
```
#0 supervisor_start_terminal
#1 in common_hal_framebufferio_framebufferdisplay_construct
#2 in framebufferio_framebufferdisplay_make_new
```
.. without an intervening stop_terminal call.
For reasons I didn't fully explore, this did not become a problem until
the ability to re-allocate a freed supervisor allocation was
implemented in adafruit#3482. Demonstrating the problem requires adafruit#3482 + adafruit#3497
+ this PR.1 parent 8d55bf9 commit 63c3c01
File tree
1 file changed
+14
-2
lines changed1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
83 | 95 | | |
84 | 96 | | |
85 | 97 | | |
| |||
0 commit comments