I’m not sure exactly what’s going on here, but the error suggests that there’s a problem with a std::function, which is probably the onClick or onStateChange members of juce::Button. Are you assigning something fishy or forgetting to assign something to these members? Or are you copying a button and the std::function isn’t copying correctly?
After hours of looking at my code I found the error. Stupid one.
I forgot to change ‘TextButton’ for a function that should accept an array of MyButtons. Since adding class member increases size of an object, buttons[0] works fine, while buttons[1] and others would point to wrong address. Sorry for my stupidity T_T