diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-10-15 17:09:43 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-15 17:09:43 -0700 |
| commit | 2ab1552484aa77d9be83decae3d588b1ca91f61c (patch) | |
| tree | cc86c54e2a538febb3611554633f52a606508d28 | |
| parent | 6b272eeb2717a319c70a03a2a230944d28ce1383 (diff) | |
| parent | 88d07ef35b686ffd66487de81564396aac0818b8 (diff) | |
Merge pull request #3551 from jepler/displayio-multidisplay-leak
displayio: further ensure just one start_terminal call
| -rw-r--r-- | shared-module/displayio/Display.c | 6 | ||||
| -rw-r--r-- | shared-module/displayio/display_core.c | 5 | ||||
| -rw-r--r-- | shared-module/framebufferio/FramebufferDisplay.c | 6 |
3 files changed, 12 insertions, 5 deletions
diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 499c00ffb..7c8c9280b 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -347,8 +347,10 @@ void common_hal_displayio_display_set_rotation(displayio_display_obj_t* self, in 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].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); } diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 60a8ef213..411f9f373 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -85,7 +85,10 @@ void displayio_display_core_construct(displayio_display_core_t* self, self->bus = bus; - supervisor_start_terminal(width, height); + // (offsetof core is equal in all display types) + if (self == &displays[0].display.core) { + supervisor_start_terminal(width, height); + } self->width = width; self->height = height; 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); } |
