| 159 | |
| 160 | |
| 161 | void DebuggerStatusBarContainer::freeDebuggerConsoleForView(QObject* obj) |
| 162 | { |
| 163 | // A old-style cast must be used here since qobject_cast will fail because |
| 164 | // the object is on the brink of deletion. |
| 165 | auto* vf = (ViewFrame*)obj; |
| 166 | |
| 167 | // Confirm there is a record of this view. |
| 168 | if (!m_consoleMap.count(vf)) |
| 169 | { |
| 170 | LogWarn("Attempted to free DebuggerConsole for untracked view %p", obj); |
| 171 | return; |
| 172 | } |
| 173 | |
| 174 | auto* console = m_consoleMap[vf]; |
| 175 | m_consoleStack->removeWidget(console); |
| 176 | m_consoleMap.remove(vf); |
| 177 | |
| 178 | // Must be called so the ChatBox is guaranteed to be destroyed. If two |
| 179 | // instances for the same view/database exist, things will break. |
| 180 | console->deleteLater(); |
| 181 | } |
| 182 | |
| 183 | |
| 184 | void DebuggerStatusBarContainer::notifyViewChanged(ViewFrame* frame) |