That crash is a classic:
Class members are constructed in the order of appearance in the class declaration and destroyed in the opposite order (what @Xenakios hinted in his post).
If you make sure to declare the Slider BEFORE the SliderAttachment you are safe from that crash, no code necessary. But I also like this suggestion from @yfede: