how about r63190?
It should resolve the position updated, it doesn't fix the mem leak, though.
The mem leak is somewhat an odd issue.
It only leaks, if the control was FOCUSED at the time the window was closing.
If the slider didn't have a focus at the time, it's frees all of its memory.
I'm somewhat concerned, that this is more Cocoa's internal kitchen. LCL releases all of its "retains" to the Cocoa object. Added
a bug report about it.