Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free the bitmap when set to empty string #168

Merged
merged 1 commit into from
Apr 2, 2022
Merged

Free the bitmap when set to empty string #168

merged 1 commit into from
Apr 2, 2022

Conversation

Neradoc
Copy link
Contributor

@Neradoc Neradoc commented Apr 2, 2022

In the latest release, setting the text to an empty string, then back to a string of the same size as the previous (non-empty) value, the bitmap label would not be updated, remaining invisible until its size changed. See this code for example. This is because self._bitmap was still set, with the right size, so was self._tilegrid, so self._local_group remained empty.

(Also one use of self._text instead of text fixed).

In the latest release, setting the text to an empty string, then back to a string of the same size as the previous value, the bitmap label would not be updated. [See this code for example](https://github.com/adafruit/Adafruit_CircuitPython_MacroPad/blob/main/examples/macropad_grid_layout.py). In addition, clearing the memory when the text is empty seems to me to match expectations.

(Also use `text` instead of `self._text`).
Copy link
Contributor

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This makes sense to me. Assuming you tested. Making a release immediately.

@dhalbert dhalbert merged commit de3276c into adafruit:main Apr 2, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Apr 2, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_ATECC to 1.2.10 from 1.2.9:
  > Reformatted per new black version
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_BMP280 to 3.2.12 from 3.2.11:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Post-patch cleanup
  > Merge pull request adafruit/Adafruit_CircuitPython_BMP280#35 from tekktrik/readme-patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_BMP3XX to 1.3.10 from 1.3.9:
  > Reformatted per new black version
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_DPS310 to 2.1.2 from 2.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DPS310#22 from caternuson/iss21
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_DS1841 to 1.0.8 from 1.0.7:
  > Reformatted per new black version
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_LC709203F to 2.2.2 from 2.2.1:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Removed extra space
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3MDL to 1.1.13 from 1.1.12:
  > Reformatted per new black version
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_LTR390 to 1.1.5 from 1.1.4:
  > Reformatted per new black version
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX7219 to 1.5.2 from 1.5.1:
  > Reformatted per new black version
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP2515 to 1.0.12 from 1.0.11:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP4728 to 1.2.3 from 1.2.2:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90640 to 1.2.7 from 1.2.6:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_MPR121 to 2.1.11 from 2.1.10:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_MPU6050 to 1.1.11 from 1.1.10:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_MS8607 to 1.0.10 from 1.0.9:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8591 to 1.0.7 from 1.0.6:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_RA8875 to 3.1.10 from 3.1.9:
  > Update Black to latest.
  > Merge pull request adafruit/Adafruit_CircuitPython_RA8875#29 from Neradoc/fix-documentation
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_TC74 to 1.0.7 from 1.0.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_TC74#6 from Neradoc/fix-documentation
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_TMP006 to 2.1.9 from 2.1.8:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2561 to 3.3.9 from 3.3.8:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_VC0706 to 4.3.1 from 4.3.0:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_AVRprog to 1.4.4 from 1.4.3:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_BoardTest to 1.2.10 from 1.2.9:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.22.3 from 2.22.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#168 from Neradoc/patch-1
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Notification to 0.9.8 from 0.9.7:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 1.15.5 from 1.15.4:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_RTTTL to 2.4.12 from 2.4.11:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README
@Neradoc Neradoc deleted the patch-1 branch April 22, 2022 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants