summaryrefslogtreecommitdiff
path: root/shared-module/framebufferio/FramebufferDisplay.c
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-10-13 16:57:09 -0500
committerJeff Epler <jepler@gmail.com>2020-10-15 15:24:19 -0500
commit88d07ef35b686ffd66487de81564396aac0818b8 (patch)
tree98ac0dda47cb908d41fcdf64ba2e67f4600bf2be /shared-module/framebufferio/FramebufferDisplay.c
parenta57c5a10f6437f64ab922c78296421eb5ec20815 (diff)
displayio: further ensure just one start_terminal call
@cwalther determined that for boards with 2 displays (monster m4sk), start_terminal would be called for each one, leaking supervisor heap entries. Determine, by comparing addresses, whether the display being acted on is the first display (number zero) and do (or do not) call start_terminal. stop_terminal can safely be called multiple times, so there's no need to guard against calling it more than once. Slight behavioral change: The terminal size would follow the displays[0] size, not the displays[1] size
Diffstat (limited to 'shared-module/framebufferio/FramebufferDisplay.c')
-rw-r--r--shared-module/framebufferio/FramebufferDisplay.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c
index 6b506c7fa..03e121c91 100644
--- a/shared-module/framebufferio/FramebufferDisplay.c
+++ b/shared-module/framebufferio/FramebufferDisplay.c
@@ -280,8 +280,10 @@ void common_hal_framebufferio_framebufferdisplay_set_rotation(framebufferio_fram
self->core.height = tmp;
}
displayio_display_core_set_rotation(&self->core, rotation);
- supervisor_stop_terminal();
- supervisor_start_terminal(self->core.width, self->core.height);
+ if (self == &displays[0].framebuffer_display) {
+ supervisor_stop_terminal();
+ supervisor_start_terminal(self->core.width, self->core.height);
+ }
if (self->core.current_group != NULL) {
displayio_group_update_transform(self->core.current_group, &self->core.transform);
}