Consider following code:
if value and self.fps_display is None:
self.fps_display = clock.ClockDisplay()
elif not value and self.fps_display is not None:
self.fps_display.unschedule()
# Do this
del self.fps_display
# or this
self.fps_display = None
# or leave both in ?
Which is better python cleanup ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…