canvas::NasalWidget: don't call unsafe method in destructor
Calling a virtual method in a destructor has undefined behaviour. Furthermore passing 'this' to nasal from within the destructor is not safe. 'onRemove' is called for widgets within layouts on destruction anyhow, so no need to call it here again. If widgets are arranged manually without any layout 'onRemoved' should be called upon removing them from a dialog.
This commit is contained in:
@@ -45,7 +45,7 @@ namespace canvas
|
||||
//----------------------------------------------------------------------------
|
||||
NasalWidget::~NasalWidget()
|
||||
{
|
||||
onRemove();
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user