Fix crash on deleting instrument with controller connections on knobs (#5306)
Knob::friendlyUpdate() can be called after the model is deleted due to signal-slot connections. Adding a check for the model fixes a crash due to null pointer dereference.
This commit is contained in:
@@ -803,9 +803,9 @@ void Knob::enterValue()
|
||||
|
||||
void Knob::friendlyUpdate()
|
||||
{
|
||||
if( model()->controllerConnection() == NULL ||
|
||||
if (model() && (model()->controllerConnection() == NULL ||
|
||||
model()->controllerConnection()->getController()->frequentUpdates() == false ||
|
||||
Controller::runningFrames() % (256*4) == 0 )
|
||||
Controller::runningFrames() % (256*4) == 0))
|
||||
{
|
||||
update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user