Skip to content

Commit

Permalink
fix: Fix possible crashes caused by mouse release events
Browse files Browse the repository at this point in the history
   Fix possible crashes caused by mouse release events

Log: Fix possible crashes caused by mouse release events
  • Loading branch information
starhcq committed May 29, 2024
1 parent 07e4552 commit cf94e1f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/common/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,8 @@ void MainWindow::menuItemInvoked(QAction *pAction)

bool MainWindow::isActionAllowed(ActionFactory::ActionKind actionKind, bool fromUI, bool isShortcut)
{
Q_ASSERT(m_pEngine);

if (m_bInBurstShootMode) {
return false;
}
Expand Down Expand Up @@ -1716,6 +1718,9 @@ void MainWindow::requestAction(ActionFactory::ActionKind actionKind, bool bFromU
{
qInfo() << "actionKind = " << actionKind << "fromUI " << bFromUI << (bIsShortcut ? "shortcut" : "");

Q_ASSERT(m_pToolbox);
Q_ASSERT(m_pCommHintWid);

if (!m_pToolbox->getbAnimationFinash() || m_bStartAnimation) {
return;
}
Expand Down Expand Up @@ -2751,6 +2756,8 @@ DSettingsDialog *MainWindow::initSettings()

void MainWindow::play(const QList<QString> &listFiles)
{
Q_ASSERT(m_pEngine);

QList<QUrl> lstValid;
QList<QString> lstDir;
QList<QString> lstFile;
Expand Down Expand Up @@ -3780,7 +3787,7 @@ void MainWindow::mouseReleaseEvent(QMouseEvent *ev)

qInfo() << __func__ << "进入mouseReleaseEvent";

if (!insideResizeArea(ev->globalPos()) && !m_bMouseMoved && (m_pPlaylist->state() != PlaylistWidget::Opened)) {
if (!insideResizeArea(ev->globalPos()) && !m_bMouseMoved && m_pPlaylist && (m_pPlaylist->state() != PlaylistWidget::Opened)) {
if (!insideToolsArea(ev->pos())) {
m_delayedMouseReleaseTimer.start(120);
} else {
Expand Down

0 comments on commit cf94e1f

Please sign in to comment.