MCPcopy Create free account
hub / github.com/KDE/kid3 / cleanup

Method cleanup

src/plugins/qmlcommand/qmlcommandplugin.cpp:74–92  ·  view source on GitHub ↗

* Cleanup processor. * This method must be invoked to close and delete the GUI resources. */

Source from the content-addressed store, hash-verified

72 * This method must be invoked to close and delete the GUI resources.
73 */
74void 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected