Skip to content
Snippets Groups Projects
Commit 466b5536 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Fl_Widget destructor generates one last FL_HIDE event which causes...

BUG: Fl_Widget destructor generates one last FL_HIDE event which causes segmentation fault (maybe because the object is already in its desctruction process). Therefore we should avoid to process FL_HIDE events.
parent 2a3ccba4
Branches develop
Tags 2.0.1
No related merge requests found
......@@ -37,7 +37,10 @@ GlWidget
}
GlWidget::~GlWidget()
{}
{
// Clear registered controller
m_Controller = NULL;
}
void GlWidget::PrintSelf(std::ostream& os, itk::Indent indent) const
{
......@@ -123,15 +126,17 @@ void GlWidget::resize(int x, int y, int w, int h)
int GlWidget::handle(int event)
{
// If there is a controller
if(m_Controller.IsNotNull())
{
return m_Controller->HandleWidgetEvent(m_Identifier,event);
}
else
// Call superclass implementation
int resp = Fl_Widget::handle(event);
// Check if there is a controller
// Avoid processing hide events, since it causes segfault (the
// destructor of the Fl class generates hide events).
if(m_Controller.IsNotNull() && event != FL_HIDE)
{
return 0;
resp = m_Controller->HandleWidgetEvent(m_Identifier,event);
}
return resp;
}
GlWidget::PointType GlWidget::GetMousePosition()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment