When I put delete in the destructor of my class, the system crashes when I exit the program.
For example I use wxWidgets radiobutton:
wxRadioButton *rb1;
I initialize it this way in the constructor of my class:
rb1 = new wxRadioButton(this, ID_RADIOBUTTON_1, _T("&Bied"), wxPoint(310,40), wxSize(110,20),wxRB_GROUP);
and I delete in the destructor of that class:
if (rb1) delete rb1;
but it crashes every time, I have to put it on comment so it won't crash, (but I know its not the right way to deal with it).