diff --git a/mrv2/docs/HISTORY.md b/mrv2/docs/HISTORY.md index 20e7cacb5..3c643451e 100644 --- a/mrv2/docs/HISTORY.md +++ b/mrv2/docs/HISTORY.md @@ -7,6 +7,7 @@ v0.8.3 - Fixed Annotations shifting when moving clips around in the Timeline Viewport (feature of v0.9.0 not yet finished by Darby). - Added support for HDR Radiance (.hdr) format. +- Fixed a crash when deleting the last clip from the Files Panel. v0.8.2 diff --git a/mrv2/lib/mrvPanels/mrvFilesPanel.cpp b/mrv2/lib/mrvPanels/mrvFilesPanel.cpp index d2cbe6574..722a05a58 100644 --- a/mrv2/lib/mrvPanels/mrvFilesPanel.cpp +++ b/mrv2/lib/mrvPanels/mrvFilesPanel.cpp @@ -228,8 +228,6 @@ namespace mrv file::Path lastPath; - const std::string tmpdir = tmppath() + "/"; - for (size_t i = 0; i < numFiles; ++i) { const auto& media = files->getItem(i); @@ -417,7 +415,6 @@ namespace mrv void FilesPanel::redraw() { - TLRENDER_P(); otio::RationalTime time = otio::RationalTime(0.0, 1.0); diff --git a/mrv2/lib/mrvUI/mrvMenus.cpp b/mrv2/lib/mrvUI/mrvMenus.cpp index 09997aba3..bd34f1e69 100644 --- a/mrv2/lib/mrvUI/mrvMenus.cpp +++ b/mrv2/lib/mrvUI/mrvMenus.cpp @@ -62,8 +62,8 @@ namespace mrv char buf[256]; const auto model = ui->app->filesModel(); - const auto files = model->observeFiles(); - size_t numFiles = files->getSize(); + const auto& files = model->observeFiles()->get(); + size_t numFiles = files.size(); menu->clear(); @@ -909,10 +909,9 @@ namespace mrv if (options.showMarkers) item->set(); - const int aIndex = ui->app->filesModel()->observeAIndex()->get(); - if (numFiles > 0 && aIndex >= 0) + const int aIndex = model->observeAIndex()->get(); + if (numFiles > 0 && aIndex >= 0 && aIndex < numFiles) { - const auto files = ui->app->filesModel()->observeFiles()->get(); std::string fileName = files[aIndex]->path.get(-1, false); const std::regex& regex = version_regex(ui, false);