Skip to content

Commit cc6a31d

Browse files
committed
Prep for 3.0.6
1 parent f4c2d78 commit cc6a31d

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

library/rpi_ws281x/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# New canonical package, to support `import rpi_ws281x`
22
from .rpi_ws281x import PixelStrip, Adafruit_NeoPixel, Color
33

4-
__version__ = '3.0.5'
4+
__version__ = '3.0.6'

library/rpi_ws281x/rpi_ws281x.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ def __init__(self, num, pin, freq_hz=800000, dma=10, invert=False, brightness=12
6464

6565
self._gamma = gamma
6666

67-
# Keep track of successful init so we don't call ws2811_fini unecessarily
68-
self._init_successful = False
69-
7067
# Create ws2811_t structure and fill in parameters.
7168
self._leds = ws.new_ws2811_t()
7269

@@ -97,23 +94,12 @@ def __init__(self, num, pin, freq_hz=800000, dma=10, invert=False, brightness=12
9794
# Substitute for __del__, traps an exit condition and cleans up properly
9895
atexit.register(self._cleanup)
9996

100-
def __del__(self):
101-
# Required because Python will complain about memory leaks
102-
# However there's no guarantee that "ws" will even be set
103-
# when the __del__ method for this class is reached.
104-
if ws != None:
105-
self._cleanup()
106-
10797
def _cleanup(self):
10898
# Clean up memory used by the library when not needed anymore.
10999
if self._leds is not None:
110-
if self._init_successful:
111-
ws.ws2811_fini(self._leds)
112-
113100
ws.delete_ws2811_t(self._leds)
114101
self._leds = None
115102
self._channel = None
116-
# Note that ws2811_fini will free the memory used by led_data internally.
117103

118104
def setGamma(self, gamma):
119105
if type(gamma) is list and len(gamma) == 256:
@@ -130,8 +116,6 @@ def begin(self):
130116
str_resp = ws.ws2811_get_return_t_str(resp)
131117
raise RuntimeError('ws2811_init failed with code {0} ({1})'.format(resp, str_resp))
132118

133-
self._init_successful = True
134-
135119
def show(self):
136120
"""Update the display with the data from the LED buffer."""
137121
resp = ws.ws2811_render(self._leds)

library/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def run(self):
1717
build_py.run(self)
1818

1919
setup(name = 'rpi_ws281x',
20-
version = '3.0.5',
20+
version = '3.0.6',
2121
author = 'Jeremy Garff <[email protected]>, Phil Howard <[email protected]>',
2222
author_email = '[email protected]',
2323
description = 'Userspace Raspberry Pi PWM/PCM/SPI library for SK6812 and WS281X LEDs.',

0 commit comments

Comments
 (0)