Skip to content

Commit 2ab1552

Browse files
authored
Merge pull request #3551 from jepler/displayio-multidisplay-leak
displayio: further ensure just one start_terminal call
2 parents 6b272ee + 88d07ef commit 2ab1552

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

shared-module/displayio/Display.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,10 @@ void common_hal_displayio_display_set_rotation(displayio_display_obj_t* self, in
347347
self->core.height = tmp;
348348
}
349349
displayio_display_core_set_rotation(&self->core, rotation);
350-
supervisor_stop_terminal();
351-
supervisor_start_terminal(self->core.width, self->core.height);
350+
if (self == &displays[0].display) {
351+
supervisor_stop_terminal();
352+
supervisor_start_terminal(self->core.width, self->core.height);
353+
}
352354
if (self->core.current_group != NULL) {
353355
displayio_group_update_transform(self->core.current_group, &self->core.transform);
354356
}

shared-module/displayio/display_core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ void displayio_display_core_construct(displayio_display_core_t* self,
8585
self->bus = bus;
8686

8787

88-
supervisor_start_terminal(width, height);
88+
// (offsetof core is equal in all display types)
89+
if (self == &displays[0].display.core) {
90+
supervisor_start_terminal(width, height);
91+
}
8992

9093
self->width = width;
9194
self->height = height;

shared-module/framebufferio/FramebufferDisplay.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,10 @@ void common_hal_framebufferio_framebufferdisplay_set_rotation(framebufferio_fram
280280
self->core.height = tmp;
281281
}
282282
displayio_display_core_set_rotation(&self->core, rotation);
283-
supervisor_stop_terminal();
284-
supervisor_start_terminal(self->core.width, self->core.height);
283+
if (self == &displays[0].framebuffer_display) {
284+
supervisor_stop_terminal();
285+
supervisor_start_terminal(self->core.width, self->core.height);
286+
}
285287
if (self->core.current_group != NULL) {
286288
displayio_group_update_transform(self->core.current_group, &self->core.transform);
287289
}

0 commit comments

Comments
 (0)