* Cleanup processor. * This method must be invoked to close and delete the GUI resources. */
| 72 | * This method must be invoked to close and delete the GUI resources. |
| 73 | */ |
| 74 | void QmlCommandPlugin::cleanup() |
| 75 | { |
| 76 | if (m_qmlView) { |
| 77 | m_qmlView->close(); |
| 78 | } |
| 79 | delete m_qmlView; |
| 80 | m_qmlView = nullptr; |
| 81 | // If m_qmlEngine is deleted, kid3-cli segfaults the second time "execute @qml" |
| 82 | // is used in interactive mode. The UI application will crash if both |
| 83 | // m_qmlEngine and m_qmlView have been constructed, deleting both |
| 84 | // will result in a crash upon termination (Bug 457655). This happens when |
| 85 | // using both a @qml user action (e.g. TitleCase.qml) and a @qmlview |
| 86 | // user action (QmlConsole.qml). This also happens if m_app is set as a parent |
| 87 | // of m_qmlEngine and it is deleted when m_app is deleted. Therefore, |
| 88 | // m_qmlEngine is not deleted. |
| 89 | if (s_messageHandlerInstance == this) { |
| 90 | s_messageHandlerInstance = nullptr; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Start a QML script. |
nothing calls this directly
no outgoing calls
no test coverage detected