bonjour, j'ai un problème d'exécution de mon programme, lorsque je lance une fonction lié à un bouton ça me fait une Erreur de segmentation et je ne comprend pas pourquoi.

Voici le code en question:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
 
void MainFrame::OnOptTrait(wxCommandEvent& event)
{
 
	EpaisseurDialog *edlg = new EpaisseurDialog ( this, -1, wxT("Epaisseur") );
	edlg->Slider_epaisseur->SetValue(epaisseurtraitcourante );
	edlg->ShowModal();
	epaisseurtraitcourante = edlg->Slider_epaisseur->GetValue();
 
}
voici le code du constructeur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
BEGIN_EVENT_TABLE(EpaisseurDialog, wxDialog)
END_EVENT_TABLE ()
 
 
EpaisseurDialog::EpaisseurDialog( wxWindow *parent, wxWindowID id, const wxString &title ) 
: wxDialog( parent, id, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{
 
  wxBoxSizer *BSizer_tout = new wxBoxSizer( wxVERTICAL );
  wxBoxSizer *BSizer_gauche = new wxBoxSizer( wxVERTICAL );
  wxBoxSizer *BSizer_droite = new wxBoxSizer( wxVERTICAL );
  wxBoxSizer *BSizer_gd = new wxBoxSizer( wxHORIZONTAL );
 
   wxStaticText *SText_epaisseur = new wxStaticText( this, ID_TEXT_EPAISSEUR, wxT("Choisir la nouvelle epaisseur de trait:"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE );
   BSizer_tout->Add( SText_epaisseur, 0, wxALIGN_CENTRE|wxALL, 5 );
 
 
  TCtrl_epaisseur = new wxTextCtrl ( this, ID_CTRL_EPAISSEUR, wxT("1"), wxDefaultPosition, wxDefaultSize );
  // On ajoute les elements dans le sizer correspondant a la partie gauche
  BSizer_gauche->Add(TCtrl_epaisseur, 0, wxALIGN_LEFT|wxALL, 5 );
 
  wxSlider *Slider_epaisseur = new wxSlider( this, ID_SLIDER, 1, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL  | wxSL_LABELS  |wxSL_BOTTOM |
wxSL_AUTOTICKS,  wxDefaultValidator, wxT("slider") );
 
 
  Slider_epaisseur->SetTickFreq(1, 1); // Mise en place de la fréquence des graduations
  Slider_epaisseur->SetTick(1);
 
  BSizer_droite->Add( Slider_epaisseur, 0,  wxALIGN_RIGHT|wxALL, 5 );
 
  BSizer_gd->Add( BSizer_gauche, 0, wxALIGN_CENTRE|wxALL, 5 ); 
  BSizer_gd->Add( BSizer_droite, 0, wxALIGN_CENTRE|wxALL, 5 ); 
 
  BSizer_tout->Add( BSizer_gd, 0, wxALIGN_CENTRE|wxALL, 5 );  
  wxButton *Bouton = new wxButton( this, wxID_OK, wxT("OK"), wxDefaultPosition );
  BSizer_tout->Add( Bouton, 0, wxALIGN_CENTRE|wxALL, 5 );
 
  this->SetAutoLayout( TRUE ) ;
  this->SetSizer( BSizer_tout );
  BSizer_tout->Fit( this);
 
  BSizer_tout->SetSizeHints( this);
}
voici les eurreurs que me donne gdb:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
Program received signal SIGSEGV, Segmentation fault.
0x080546db in MainFrame::OnOptTrait(wxCommandEvent&) ()
#0  0x080546db in MainFrame::OnOptTrait(wxCommandEvent&) ()
#1  0x00871a9f in wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const
    () from /usr/lib/libwx_baseu-2.8.so.0
#2  0x00910209 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
    () from /usr/lib/libwx_baseu-2.8.so.0
#3  0x009112d4 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) ()
   from /usr/lib/libwx_baseu-2.8.so.0
#4  0x009113d3 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-2.8.so.0
#5  0x00642d79 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#6  0x0128edcc in g_cclosure_marshal_VOID__VOID () from /usr/lib/libgobject-2.0.so.0
#7  0x01281252 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#8  0x0129599d in ?? () from /usr/lib/libgobject-2.0.so.0
pouvez vous m'expliquer d'où vient mon erreur?

Merci de votre compréhension.