From b62f94f5c2e64d68c8b8ca7aefc0b28eed3a6eaa Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 20 May 2019 18:36:24 +0200 Subject: [PATCH] Pcbnew: release the lock file if a board was loaded, and when clearing the board currently edited. When the board is cleared, the previous loaded board is no longer in edit. --- pcbnew/files.cpp | 2 +- pcbnew/initpcb.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index d151b9534c..0526b66823 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -418,7 +418,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in } // Release the lock file, until the new file is actually loaded - m_file_checker.reset( nullptr ); + ReleaseFile(); wxFileName pro = fullFileName; pro.SetExt( ProjectFileExtension ); diff --git a/pcbnew/initpcb.cpp b/pcbnew/initpcb.cpp index c1cd1b8274..d0c64bb7dc 100644 --- a/pcbnew/initpcb.cpp +++ b/pcbnew/initpcb.cpp @@ -48,6 +48,9 @@ bool PCB_EDIT_FRAME::Clear_Pcb( bool aQuery ) return false; } + // Release the lock file, if exists + ReleaseFile(); + // Clear undo and redo lists because we want a full deletion GetScreen()->ClearUndoRedoList(); GetScreen()->ClrModify();