Skip to content

Crash on deleting instrument tracks with knobs connected to controllers #5106

@PhysSong

Description

@PhysSong

Reported by @douglasdgi on Discord:

When you delete an instrument track with any knob connected to any controller, LMMS crashes (in Knob::friendlyUpdate, according to gdb)

It's related to the stupid InstrumentTrackWindow caching system.

  • The InstrumentTrackView destructor calls
    InstrumentTrackView::freeInstrumentTrackWindow(), and it calls InstrumentTrackWindow::updateInstrumentView(). the function deletes and then re-instantiates m_instrumentView. It results in deleting the instrument before deleting the view.
  • An InstrumentTrackWindow instance may still exist after the corresponding track is deleted, making the knob still updated after the model is deleted. Since the mixer thread handles value changes from controllers, the slot might be invoked after the sender(model) is deleted.

It seems like the current caching system is doing unnecessary jobs and causes some bugs like #3623 as well as this one.

Anyway, Knob::friendlyUpdate should check for the model and do nothing if it's null or already deleted.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions