set_data_classA receives data By pointer (a_classA.data is a pointer);
Mygeneralclass is declared as private on the form I'm working.
I don't know how is it possible that I the data passed by pointer does not dissapear when the control of the program leaves the code for button_click.
Then data was created for a_classA, but the life of a_classA is restrited to the button_click, ins't it ?
set_data_classA is declared as set_data_classA(*data) {my_data=data]
It's undefined behavior. You can't rely on the fact that the pointer is still pointing to a valid class. I would've expected, possibly, a segfault for that.