diff --git a/adafruit_display_text/bitmap_label.py b/adafruit_display_text/bitmap_label.py index 7987b6a..50c426f 100755 --- a/adafruit_display_text/bitmap_label.py +++ b/adafruit_display_text/bitmap_label.py @@ -154,6 +154,10 @@ def _reset_text( for _ in self._local_group: self._local_group.pop(0) + # Free the bitmap and tilegrid since they are removed + self._bitmap = None + self._tilegrid = None + else: # The text string is not empty, so create the Bitmap and TileGrid and # append to the self Group @@ -200,9 +204,7 @@ def _reset_text( # Place the text into the Bitmap self._place_text( self._bitmap, - text - if self._label_direction != "RTL" - else "".join(reversed(self._text)), + text if self._label_direction != "RTL" else "".join(reversed(text)), self._font, self._padding_left - x_offset, self._padding_top + y_offset,