diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 5b7bda64b3..cbdfade849 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -308,6 +308,13 @@ void PGM_BASE::destroy() m_html_ctrl = 0; } +void PGM_BASE::ReleaseFile() +{ + // Release the current file marked in use. + delete m_file_checker; + m_file_checker = 0; +} + void PGM_BASE::SetEditorName( const wxString& aFileName ) { diff --git a/common/project.cpp b/common/project.cpp index 079464eb1f..51f9b41287 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -251,7 +251,7 @@ wxConfigBase* PROJECT::configCreate( const SEARCH_STACK& aSList, if( wxFileName( cur_pro_fn ).IsFileReadable() ) { // Note: currently, aGroupName is not used. - // Previoulsy, the version off aGroupName was tested, but it + // Previoulsy, the version of aGroupName was tested, but it // was useless, and if the version is important, // this is not the right place here, because configCreate does know anything // about info stored in this config file. diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 117d9c7e80..cc4d5b463a 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -417,6 +417,8 @@ SCH_EDIT_FRAME::~SCH_EDIT_FRAME() m_undoItem = NULL; g_RootSheet = NULL; m_findReplaceData = NULL; + + Pgm().ReleaseFile(); // Release the lock on root file } void SCH_EDIT_FRAME::SetRepeatItem( SCH_ITEM* aItem ) diff --git a/include/pgm_base.h b/include/pgm_base.h index 89587d00a1..e2fc807652 100644 --- a/include/pgm_base.h +++ b/include/pgm_base.h @@ -179,6 +179,12 @@ public: */ VTBL_ENTRY bool LockFile( const wxString& aFileName ); + /** + * Function ReleaseFile + * Release the current file marked in use. + */ + VTBL_ENTRY void ReleaseFile(); + /** * Function App * returns a bare naked wxApp, which may come from wxPython, SINGLE_TOP, or kicad.exe. diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 8b9dae04f7..3edcb7cdaa 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -486,6 +486,8 @@ PCB_EDIT_FRAME::~PCB_EDIT_FRAME() m_Macros[i].m_Record.clear(); delete m_drc; + + Pgm().ReleaseFile(); // Release the lock on PCB file }