Fix crash deleting bin clip with keyframe effect

parent 11c5a018
......@@ -284,10 +284,18 @@ void EffectStackView::unsetModel(bool reset)
// Release ownership of smart pointer
if (m_model) {
disconnect(m_model.get(), &EffectStackModel::dataChanged, this, &EffectStackView::refresh);
// Make sure to delete the delegates
for (int i = 0; i < m_model->rowCount(); i++) {
std::shared_ptr<AbstractEffectItem> item = m_model->getEffectStackRow(i);
std::shared_ptr<EffectItemModel> eff = std::static_pointer_cast<EffectItemModel>(item);
QModelIndex ix = m_model->getIndexFromItem(eff);
auto w = m_effectsTree->indexWidget(ix);
delete w;
}
}
if (reset) {
m_model.reset();
}
}
}
void EffectStackView::setRange(int in, int out)
......
......@@ -1341,6 +1341,7 @@ void Monitor::slotOpenClip(std::shared_ptr<ProjectClip> controller, int in, int
disconnect(m_controller->getMarkerModel().get(), SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SLOT(checkOverlay()));
}
m_controller = controller;
loadQmlScene(MonitorSceneDefault);
m_snaps.reset(new SnapModel());
if (controller) {
m_controller->getMarkerModel()->registerSnapModel(m_snaps);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment