| 36 | } |
| 37 | |
| 38 | FormatterPlugin::~FormatterPlugin() { |
| 39 | waitUntilLoaded(); |
| 40 | mShuttingDown = true; |
| 41 | unsubscribeFileSystemListener(); |
| 42 | |
| 43 | if ( mWorkersCount != 0 ) { |
| 44 | std::unique_lock<std::mutex> lock( mWorkMutex ); |
| 45 | mWorkerCondition.wait( lock, [this]() { return mWorkersCount <= 0; } ); |
| 46 | } |
| 47 | |
| 48 | for ( auto& editor : mEditors ) { |
| 49 | for ( auto& kb : mKeyBindings ) { |
| 50 | editor.first->getKeyBindings().removeCommandKeybind( kb.first ); |
| 51 | if ( editor.first->hasDocument() ) |
| 52 | editor.first->getDocument().removeCommand( kb.first ); |
| 53 | } |
| 54 | for ( auto listener : editor.second ) |
| 55 | editor.first->removeEventListener( listener ); |
| 56 | editor.first->unregisterPlugin( this ); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | void FormatterPlugin::onRegister( UICodeEditor* editor ) { |
| 61 | std::vector<Uint32> listeners; |
nothing calls this directly
no test coverage detected