I compiled wxWidgets-3.1.2 again and re-compiled my current project - everything without problems.
The program that I am developing runs smoothly. The only problem that I am now facing is an abnormal program exit.
I digged a bit deeper into my program and commented out several parts to see when this problem starts to occur.
Below is the basic version that generates the abnormal exit:
Code: Select all
previewFrame::previewFrame(wxWindow* parent,wxWindowID id) {
//(*Initialize(previewFrame)
wxMenu* Menu1;
wxMenu* Menu2;
wxMenuBar* MenuBar1;
wxMenuItem* MenuItem1;
wxMenuItem* MenuItem2;
Create(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
SetClientSize(wxSize(329,335));
MenuBar1 = new wxMenuBar();
Menu1 = new wxMenu();
MenuItem3 = new wxMenuItem(Menu1, ID_MENUITEM1, _("Load"), wxEmptyString, wxITEM_NORMAL);
Menu1->Append(MenuItem3);
MenuItem4 = new wxMenuItem(Menu1, ID_MENUITEM2, _("Settings"), wxEmptyString, wxITEM_NORMAL);
Menu1->Append(MenuItem4);
MenuItem1 = new wxMenuItem(Menu1, idMenuQuit, _("Quit\tAlt-F4"), _("Quit the application"), wxITEM_NORMAL);
Menu1->Append(MenuItem1);
MenuBar1->Append(Menu1, _("&File"));
Menu2 = new wxMenu();
MenuItem2 = new wxMenuItem(Menu2, idMenuAbout, _("About\tF1"), _("Show info about this application"), wxITEM_NORMAL);
Menu2->Append(MenuItem2);
MenuBar1->Append(Menu2, _("Help"));
SetMenuBar(MenuBar1);
Connect(ID_MENUITEM2,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&previewFrame::OnSettings);
//*)
// prepare the settings dialog
settings = new SettingsDlg(this, wxID_ANY, _("Settings"), wxDefaultPosition, wxSize(600, 400));
}
class SettingsDlg : public wxDialog {
public:
SettingsDlg( wxWindow * parent, wxWindowID id, const wxString & title,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE ):
wxDialog(parent, id, title, pos, size, style) {
panel = new wxPanel(this, wxID_ANY,
wxDefaultPosition,
wxSize(300, 300));
t1 = new wxStaticText(panel, wxID_ANY, _("Background image"), wxPoint(32,32));
t2 = new wxStaticText(panel, wxID_ANY, _("Preview size"), wxPoint(32,64));
t3 = new wxStaticText(panel, wxID_ANY, _("Horizontal angles"), wxPoint(32,96));
t4 = new wxStaticText(panel, wxID_ANY, _("Vertical angles"), wxPoint(32,128));
t5 = new wxStaticText(panel, wxID_ANY, _("Ambient image"), wxPoint(32,160));
t6 = new wxStaticText(panel, wxID_ANY, _("Ambient blur"), wxPoint(32,192));
t7 = new wxStaticText(panel, wxID_ANY, _("Glass plate"), wxPoint(32,224));
valRange.SetRange(1, 500);
TextCtrl1 = new wxTextCtrl(panel, wxID_ANY, wxEmptyString, wxPoint(136,64), wxSize(56,21), 0, valRange);
valRange.SetRange(-45, 45);
TextCtrl2 = new wxTextCtrl(panel, wxID_ANY, wxEmptyString, wxPoint(136,96), wxSize(40,21), 0, valRange);
TextCtrl3 = new wxTextCtrl(panel, wxID_ANY, wxEmptyString, wxPoint(208,96), wxSize(40,21), 0, valRange);
TextCtrl4 = new wxTextCtrl(panel, wxID_ANY, wxEmptyString, wxPoint(136,128), wxSize(40,21), 0, valRange);
TextCtrl5 = new wxTextCtrl(panel, wxID_ANY, wxEmptyString, wxPoint(208,128), wxSize(40,21), 0, valRange);
valRange.SetRange(1, 15);
TextCtrl6 = new wxTextCtrl(panel, wxID_ANY, wxEmptyString, wxPoint(136,192), wxSize(40,21), 0, valRange);
CheckBox1 = new wxCheckBox(panel, wxID_ANY, wxEmptyString, wxPoint(136,224));
FilePickerCtrl1 = new wxFilePickerCtrl(panel, wxID_ANY, wxEmptyString, wxEmptyString, wxEmptyString, wxPoint(136,32), wxSize(368,20), wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_USE_TEXTCTRL, wxDefaultValidator);
FilePickerCtrl2 = new wxFilePickerCtrl(panel, wxID_ANY, wxEmptyString, wxEmptyString, wxEmptyString, wxPoint(136,160), wxSize(368,20), wxFLP_FILE_MUST_EXIST|wxFLP_OPEN|wxFLP_USE_TEXTCTRL, wxDefaultValidator);
Button = new wxButton(panel, 12345, _("Save"), wxPoint(32,272), wxDefaultSize, 0, wxDefaultValidator);
Connect(12345,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&OnSaveClick);
}
wxIntegerValidator<int> valRange;
wxCheckBox* CheckBox1;
wxTextCtrl* TextCtrl1;
wxTextCtrl* TextCtrl2;
wxTextCtrl* TextCtrl3;
wxTextCtrl* TextCtrl4;
wxTextCtrl* TextCtrl5;
wxTextCtrl* TextCtrl6;
wxFilePickerCtrl* FilePickerCtrl1;
wxFilePickerCtrl* FilePickerCtrl2;
private:
wxPanel* panel;
wxStaticText *t1, *t2, *t3, *t4, *t5, *t6, *t7;
wxButton* Button;
wxFileConfig *ConfigINI;
void OnSaveClick(wxCommandEvent& event); // save the settings
};
Code: Select all
settings = new SettingsDlg(this, wxID_ANY, _("Settings"), wxDefaultPosition, wxSize(600, 400));
So I started to comment out parts within the constructor of SettingsDlg.
It appears that the 6 wxTextCtrl's are to blame, when I remove these the program exits without an abnormal program termination message.
Is my SettingsDlg class properly constructed? Or is this a known issue with gcc 9.2.0.
I searched the Internet but couldn't find any mentioning of problems with gcc 9.2
The message that I receive is:
I looked up the exception code and found out that is a heap corruption, so there must be something that is not properly deallocated but I can't find what...Problem signature:
Problem Event Name: APPCRASH
Application Name: preview.exe
Application Version: 0.0.0.0
Application Timestamp: 5dfd8ff1
Fault Module Name: StackHash_ebd5
Fault Module Version: 6.3.9600.17415
Fault Module Timestamp: 5450559e
Exception Code: c0000374
Exception Offset: PCH_55_FROM_ntdll+0x00000000000911FA
OS Version: 6.3.9600.2.0.0.256.48
Locale ID: 1033
Additional Information 1: ebd5
Additional Information 2: ebd5c0edf1f4c2907c369823ee6d631c
Additional Information 3: ace6
Additional Information 4: ace62d7582b2ce32e568489cbb5a8ad6