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:
Hyunjin Song
2019-11-22 21:26:47 +09:00
committed by GitHub
parent cf4bb7b851
commit a2e328e3dd

View File

@@ -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();
}