| 770 | |
| 771 | |
| 772 | void GlobalThreadFramesContainer::freeDebuggerConsoleForView(QObject* obj) |
| 773 | { |
| 774 | // A old-style cast must be used here since qobject_cast will fail because |
| 775 | // the object is on the brink of deletion. |
| 776 | auto* vf = (ViewFrame*)obj; |
| 777 | |
| 778 | // Confirm there is a record of this view. |
| 779 | if (!m_consoleMap.count(vf)) |
| 780 | { |
| 781 | LogWarn("Attempted to free DebuggerConsole for untracked view %p", obj); |
| 782 | return; |
| 783 | } |
| 784 | |
| 785 | auto* console = m_consoleMap[vf]; |
| 786 | m_consoleStack->removeWidget(console); |
| 787 | m_consoleMap.remove(vf); |
| 788 | |
| 789 | // Must be called so the ChatBox is guaranteed to be destoryed. If two |
| 790 | // instances for the same view/database exist, things will break. |
| 791 | console->deleteLater(); |
| 792 | } |
| 793 | |
| 794 | |
| 795 | void GlobalThreadFramesContainer::notifyViewChanged(ViewFrame* frame) |