Inheriting from TextButton

Hi! Probably another stupid question, but…
how can I make a class derived from TextButton?

Right now, if I put any members in my new class it crushes with exception:
" std::_Func_class::_Getimpl(…) returned 0xFFFFFFFFFFFFFF "

Currently my class looks like this:

class MyButton : public TextButton
{
public:
	int i = 0;
};

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