Browse Source

Prevent multiple reloads when saving

Avoid potential issues with Mac libedit crashes (hopefully)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14865
newinvert
Seth Hillbrand 2 years ago
parent
commit
2aab24ef29
  1. 12
      eeschema/sch_base_frame.h
  2. 4
      eeschema/symbol_editor/symbol_editor.cpp

12
eeschema/sch_base_frame.h

@ -241,6 +241,18 @@ public:
*/
void OnSymChangeDebounceTimer( wxTimerEvent& aEvent );
/**
* Set the modification time of the symbol library table file.
*
* This is used to detect changes to the symbol library table file.
*
* @param aTime is the modification time of the symbol library table file.
*/
void SetSymModificationTime( const wxDateTime& aTime )
{
m_watcherLastModified = aTime;
}
protected:
void handleActivateEvent( wxActivateEvent& aEvent ) override;

4
eeschema/symbol_editor/symbol_editor.cpp

@ -1130,6 +1130,10 @@ bool SYMBOL_EDIT_FRAME::saveLibrary( const wxString& aLibrary, bool aNewFile )
if( !aNewFile )
{
m_libMgr->ClearLibraryModified( aLibrary );
// Update the library modification time so that we don't reload based on the watcher
if( aLibrary == getTargetLib() )
SetSymModificationTime( fn.GetModificationTime() );
}
else
{

Loading…
Cancel
Save