| 142 | } |
| 143 | |
| 144 | DebuggerPlugin::~DebuggerPlugin() { |
| 145 | waitUntilLoaded(); |
| 146 | mShuttingDown = true; |
| 147 | |
| 148 | { |
| 149 | Lock l( mClientsMutex ); |
| 150 | for ( const auto& client : mClients ) |
| 151 | client.first->unregisterClient( client.second.get() ); |
| 152 | } |
| 153 | |
| 154 | if ( mSidePanel && mTab ) { |
| 155 | if ( Engine::isMainThread() ) |
| 156 | mSidePanel->removeTab( mTab ); |
| 157 | else { |
| 158 | auto sidePanel = mSidePanel; |
| 159 | auto tab = mTab; |
| 160 | mSidePanel->runOnMainThread( [sidePanel, tab] { sidePanel->removeTab( tab ); } ); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | if ( getPluginContext()->getStatusBar() ) |
| 165 | getPluginContext()->getStatusBar()->removeStatusBarElement( "status_app_debugger" ); |
| 166 | |
| 167 | mManager->unsubscribeMessages( this ); |
| 168 | |
| 169 | for ( auto editor : mEditors ) { |
| 170 | onBeforeUnregister( editor.first ); |
| 171 | onUnregisterEditor( editor.first ); |
| 172 | } |
| 173 | |
| 174 | mDebugger.reset(); |
| 175 | mListener.reset(); |
| 176 | |
| 177 | if ( SceneManager::existsSingleton() && !SceneManager::instance()->isShuttingDown() && |
| 178 | getPluginContext() && getPluginContext()->getMainLayout() ) { |
| 179 | getPluginContext()->getMainLayout()->unsetCommands( mRegisteredCommands ); |
| 180 | |
| 181 | for ( const auto& kb : mKeyBindings ) |
| 182 | getPluginContext()->getMainLayout()->getKeyBindings().removeCommandKeybind( kb.first ); |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | void DebuggerPlugin::onSaveProject( const std::string& /*projectFolder*/, |
| 187 | const std::string& projectStatePath, |
nothing calls this directly
no test coverage detected