Qt: fix random QWinTaskbarProgress crashes
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include "Emu/System.h"
|
#include "Emu/System.h"
|
||||||
#include "Emu/Cell/Modules/cellScreenshot.h"
|
#include "Emu/Cell/Modules/cellScreenshot.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -84,7 +85,8 @@ gs_frame::gs_frame(const QRect& geometry, const QIcon& appIcon, const std::share
|
|||||||
gs_frame::~gs_frame()
|
gs_frame::~gs_frame()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (m_tb_progress)
|
// QWinTaskbarProgress::hide() will crash if the application is already about to close, even if the object is not null.
|
||||||
|
if (m_tb_progress && !QCoreApplication::closingDown())
|
||||||
{
|
{
|
||||||
m_tb_progress->hide();
|
m_tb_progress->hide();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "msg_dialog_frame.h"
|
#include "msg_dialog_frame.h"
|
||||||
#include "custom_dialog.h"
|
#include "custom_dialog.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
|
|
||||||
@@ -173,7 +174,8 @@ msg_dialog_frame::msg_dialog_frame() {}
|
|||||||
msg_dialog_frame::~msg_dialog_frame()
|
msg_dialog_frame::~msg_dialog_frame()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (m_tb_progress)
|
// QWinTaskbarProgress::hide() will crash if the application is already about to close, even if the object is not null.
|
||||||
|
if (m_tb_progress && !QCoreApplication::closingDown())
|
||||||
{
|
{
|
||||||
m_tb_progress->hide();
|
m_tb_progress->hide();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "progress_dialog.h"
|
#include "progress_dialog.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@@ -37,7 +38,11 @@ progress_dialog::progress_dialog(const QString &windowTitle, const QString &labe
|
|||||||
progress_dialog::~progress_dialog()
|
progress_dialog::~progress_dialog()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
// QWinTaskbarProgress::hide() will crash if the application is already about to close, even if the object is not null.
|
||||||
|
if (!QCoreApplication::closingDown())
|
||||||
|
{
|
||||||
m_tb_progress->hide();
|
m_tb_progress->hide();
|
||||||
|
}
|
||||||
#elif HAVE_QTDBUS
|
#elif HAVE_QTDBUS
|
||||||
UpdateProgress(0);
|
UpdateProgress(0);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user