Prevent multiple reloads when saving

Avoid potential issues with Mac libedit crashes (hopefully)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14865
This commit is contained in:
Seth Hillbrand 2024-01-11 19:00:47 -08:00
parent 42e02552ac
commit 2aab24ef29
2 changed files with 16 additions and 0 deletions

View File

@ -241,6 +241,18 @@ public:
*/ */
void OnSymChangeDebounceTimer( wxTimerEvent& aEvent ); 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: protected:
void handleActivateEvent( wxActivateEvent& aEvent ) override; void handleActivateEvent( wxActivateEvent& aEvent ) override;

View File

@ -1130,6 +1130,10 @@ bool SYMBOL_EDIT_FRAME::saveLibrary( const wxString& aLibrary, bool aNewFile )
if( !aNewFile ) if( !aNewFile )
{ {
m_libMgr->ClearLibraryModified( aLibrary ); 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 else
{ {