HanSolo / medusa

A JavaFX library for Gauges
Apache License 2.0
687 stars 129 forks source link

fix disposing of gauge skins and its update listener #212

Closed protogenes closed 2 years ago

protogenes commented 2 years ago

Skins were not properly disposed because an anonymous update listener was used. The fix simply uses the existing named listener instance that will be removed in dispose()

We stumpled upon this bug when the default GaugeSkin was still handling redraw events and subsequently killed the process when trying to draw millions of radial tick marks. I assume this will improve the overall performance as well.

protogenes commented 2 years ago

On the same note: maybe remove setOnUpdate() methods on Gauge and Clock because they only add a listener and do not remove the previous one, as one might expect.

HanSolo commented 2 years ago

Thx for the heads up