diff --git a/src/tools/ecode/plugins/formatter/formatterplugin.cpp b/src/tools/ecode/plugins/formatter/formatterplugin.cpp index 997e5c80e..76135efde 100644 --- a/src/tools/ecode/plugins/formatter/formatterplugin.cpp +++ b/src/tools/ecode/plugins/formatter/formatterplugin.cpp @@ -59,7 +59,8 @@ FormatterPlugin::~FormatterPlugin() { if ( editor.first->hasDocument() ) editor.first->getDocument().removeCommand( kb.first ); } - + for ( auto listener : editor.second ) + editor.first->removeEventListener( listener ); editor.first->unregisterPlugin( this ); } } diff --git a/src/tools/ecode/plugins/lsp/lspclientplugin.cpp b/src/tools/ecode/plugins/lsp/lspclientplugin.cpp index d8280b040..db0b3c701 100644 --- a/src/tools/ecode/plugins/lsp/lspclientplugin.cpp +++ b/src/tools/ecode/plugins/lsp/lspclientplugin.cpp @@ -155,6 +155,8 @@ LSPClientPlugin::~LSPClientPlugin() { if ( editor.first->hasDocument() ) editor.first->getDocument().removeCommand( kb.first ); } + for ( auto listener : editor.second ) + editor.first->removeEventListener( listener ); editor.first->unregisterPlugin( this ); } if ( nullptr == mManager->getSplitter() )