From 74584e2081c9a38fd5d8abb5a4e4cddc93e87514 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 24 Jul 2015 09:42:46 +0200 Subject: [PATCH] Fixed crash on undo layer change in TEXTE_MODULE. --- pcbnew/class_text_mod.cpp | 3 +++ pcbnew/tools/edit_tool.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 784bd00d2e..ef83ccdee1 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -493,6 +493,9 @@ unsigned int TEXTE_MODULE::ViewGetLOD( int aLayer ) const { const int MAX = std::numeric_limits::max(); + if( !m_view ) + return 0; + if( m_Type == TEXT_is_VALUE && !m_view->IsLayerVisible( ITEM_GAL_LAYER( MOD_VALUES_VISIBLE ) ) ) return MAX; diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 80376d6099..467772752c 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -383,6 +383,7 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) // Display properties dialog BOARD_ITEM* item = selection.Item( 0 ); + // Store the head of the undo list to compare if anything has changed std::vector& undoList = editFrame->GetScreen()->m_UndoList.m_CommandsList; // Some of properties dialogs alter pointers, so we should deselect them