From a91306032ca5d3a6e04d11d18bb24f5b2b39d21d Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 5 May 2021 13:17:20 +0200 Subject: [PATCH] Project dirty state manager -> Fixed crash when loading/saving a 3mf file --- src/libslic3r/Technologies.hpp | 2 +- src/slic3r/GUI/ProjectDirtyStateManager.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index efb7ab486..1d4c63fb6 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -67,7 +67,7 @@ // Enable project dirty state manager #define ENABLE_PROJECT_DIRTY_STATE (1 && ENABLE_2_4_0_ALPHA0) // Enable project dirty state manager debug window -#define ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW (0 && ENABLE_PROJECT_DIRTY_STATE) +#define ENABLE_PROJECT_DIRTY_STATE_DEBUG_WINDOW (1 && ENABLE_PROJECT_DIRTY_STATE) #endif // _prusaslicer_technologies_h_ diff --git a/src/slic3r/GUI/ProjectDirtyStateManager.cpp b/src/slic3r/GUI/ProjectDirtyStateManager.cpp index 95cfa042e..30d41f808 100644 --- a/src/slic3r/GUI/ProjectDirtyStateManager.cpp +++ b/src/slic3r/GUI/ProjectDirtyStateManager.cpp @@ -210,8 +210,7 @@ void ProjectDirtyStateManager::reset_after_save() if (&main_stack == &active_stack) { const UndoRedo::Snapshot* saveable_snapshot = get_last_saveable_snapshot(EStackType::Main, main_stack, m_state.gizmos, m_last_save.main); - assert(saveable_snapshot != nullptr); - m_last_save.main = saveable_snapshot->timestamp; + m_last_save.main = (saveable_snapshot != nullptr) ? saveable_snapshot->timestamp : 0; } else { const UndoRedo::Snapshot* main_active_snapshot = get_active_snapshot(main_stack);