| 627 | |
| 628 | |
| 629 | void GlobalDebugModulesContainer::freeWidgetForView(QObject* obj) |
| 630 | { |
| 631 | // A old-style cast must be used here since qobject_cast will fail because |
| 632 | // the object is on the brink of deletion. |
| 633 | auto* vf = (ViewFrame*)obj; |
| 634 | |
| 635 | // Confirm there is a record of this view. |
| 636 | if (!m_widgetMap.count(vf)) |
| 637 | { |
| 638 | LogWarn("Attempted to free DebuggerConsole for untracked view %p", obj); |
| 639 | return; |
| 640 | } |
| 641 | |
| 642 | auto* console = m_widgetMap[vf]; |
| 643 | m_consoleStack->removeWidget(console); |
| 644 | m_widgetMap.remove(vf); |
| 645 | |
| 646 | // Must be called so the ChatBox is guaranteed to be destoryed. If two |
| 647 | // instances for the same view/database exist, things will break. |
| 648 | console->deleteLater(); |
| 649 | } |
| 650 | |
| 651 | |
| 652 | void GlobalDebugModulesContainer::notifyViewChanged(ViewFrame* frame) |