Skip to content
Snippets Groups Projects
Commit 81fbc423 authored by Pierre Lamot's avatar Pierre Lamot Committed by Steve Lhomme
Browse files

qt: fix use after free in first run wizard

* when MainCtx is destroyed, the medialibrary is destroyed
* dialogs provider was destroyed after the MainCtx, the dialog provider provides
  the FirstRun dialog
* FirstRun dialog uses a model from the medialibrary
parent 01934b33
No related branches found
No related tags found
1 merge request!6195qt: fix use after free in first run wizard
Pipeline #524960 passed with stage
in 19 minutes and 3 seconds
......@@ -1115,22 +1115,9 @@ static void *ThreadCleanup( qt_intf_t *p_intf, CleanupReason cleanupReason )
if ( p_intf->p_compositor )
{
if (cleanupReason == CLEANUP_INTF_CLOSED)
{
p_intf->p_compositor->unloadGUI();
delete p_intf->p_mi;
p_intf->p_mi = nullptr;
}
else // CLEANUP_APP_TERMINATED
{
p_intf->p_compositor->destroyMainInterface();
delete p_intf->p_mi;
p_intf->p_mi = nullptr;
delete p_intf->mainSettings;
p_intf->mainSettings = nullptr;
p_intf->p_compositor.reset();
}
}
/* */
......@@ -1143,10 +1130,22 @@ static void *ThreadCleanup( qt_intf_t *p_intf, CleanupReason cleanupReason )
Settings must be destroyed after that.
*/
DialogsProvider::killInstance();
VLCDialogModel::killInstance();
DialogErrorModel::killInstance();
if ( p_intf->p_compositor && cleanupReason == CLEANUP_APP_TERMINATED)
{
p_intf->p_compositor.reset();
//destroy MainCtx
delete p_intf->p_mi;
p_intf->p_mi = nullptr;
delete p_intf->mainSettings;
p_intf->mainSettings = nullptr;
}
/* Destroy the main playlist controller */
if (p_intf->p_mainPlaylistController)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment