Skip to content

Commit 3f3cf0f

Browse files
committed
Better place for resetting indicator
1 parent 156af59 commit 3f3cf0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared-module/displayio/__init__.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ static void common_hal_displayio_release_displays_impl(bool keep_primary) {
224224
display_buses[i].bus_base.type = &mp_type_NoneType;
225225
#endif
226226
}
227-
max_allocated_display = CIRCUITPY_DISPLAY_LIMIT;
228-
229227
if (!keep_primary) {
230228
supervisor_stop_terminal();
231229
}
@@ -255,6 +253,8 @@ void malloc_display_memory(void) {
255253
void reset_displays(void) {
256254
// In CircuitPython 10, release secondary displays before doing anything else:
257255
common_hal_displayio_release_displays_impl(true);
256+
// Set dynamically allocated displays to 0 (CIRCUITPY_DISPLAY_LIMIT)
257+
max_allocated_display = CIRCUITPY_DISPLAY_LIMIT;
258258

259259
// The SPI buses used by FourWires may be allocated on the heap so we need to move them inline.
260260
for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) {

0 commit comments

Comments
 (0)