Skip to content

Commit

Permalink
fixed crach bug after script player dialog closed
Browse files Browse the repository at this point in the history
  • Loading branch information
emako committed Dec 31, 2018
1 parent 699b950 commit edde428
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 10 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ version r9
version r10
- updated mediainfo to v18.12.
- changed tcas filter loaded from vs plugins.
- changed installer's compiling type from console to gui.
- added logging file size tip on loading.
- added dv2witch v2 mod to release.
- fixed job moved bug on pausing mode.
- updated some tools version.

version r11
- fixed crach bug after script player dialog closed.
2 changes: 1 addition & 1 deletion com/version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef VERSION_H
#define VERSION_H

#define QVS_VERSION "r10"
#define QVS_VERSION "r11"

#endif // VERSION_H
20 changes: 16 additions & 4 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1319,25 +1319,37 @@ void MainWindow::releaseChildWindowsAll(void)
{
for(QMap<QUuid, ScriptPlayer *>::iterator i = m_pScriptPlayers.begin(); i != m_pScriptPlayers.end(); ++i)
{
m_pScriptPlayers[i.key()]->close();
if(m_pScriptPlayers[i.key()] != nullptr)
{
m_pScriptPlayers[i.key()]->close();
}
}
m_pScriptPlayers.clear();

for(QMap<QUuid, MediaInfoDialog *>::iterator i = m_pMediaInfoDialogs.begin(); i != m_pMediaInfoDialogs.end(); ++i)
{
m_pMediaInfoDialogs[i.key()]->close();
if(m_pMediaInfoDialogs[i.key()] != nullptr)
{
m_pMediaInfoDialogs[i.key()]->close();
}
}
m_pMediaInfoDialogs.clear();

for(QMap<QUuid, PreviewDialog *>::iterator i = m_pPreviewDialogs.begin(); i != m_pPreviewDialogs.end(); ++i)
{
m_pPreviewDialogs[i.key()]->close();
if(m_pPreviewDialogs[i.key()] != nullptr)
{
m_pPreviewDialogs[i.key()]->close();
}
}
m_pPreviewDialogs.clear();

for(QMap<QUuid, ScriptCreator *>::iterator i = m_pScriptCreators.begin(); i != m_pScriptCreators.end(); ++i)
{
m_pScriptCreators[i.key()]->close();
if(m_pScriptCreators[i.key()] != nullptr)
{
m_pScriptCreators[i.key()]->close();
}
}
m_pScriptCreators.clear();
}
Expand Down
10 changes: 8 additions & 2 deletions script/script_creator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,18 @@ void ScriptCreator::release(const QUuid &a_uid)
{
if(mainUi->m_pPreviewDialogs.contains(a_uid))
{
mainUi->m_pPreviewDialogs[a_uid]->close();
if(mainUi->m_pPreviewDialogs[a_uid] != nullptr)
{
mainUi->m_pPreviewDialogs[a_uid]->close();
}
mainUi->m_pPreviewDialogs.remove(a_uid);
}
else if(mainUi->m_pScriptPlayers.contains(a_uid))
{
mainUi->m_pScriptPlayers[a_uid]->close();
if(mainUi->m_pScriptPlayers[a_uid] != nullptr)
{
mainUi->m_pScriptPlayers[a_uid]->close();
}
mainUi->m_pScriptPlayers.remove(a_uid);
}
QFile(previewScriptFilename(a_uid)).remove();
Expand Down
5 changes: 4 additions & 1 deletion script/script_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ void ScriptPlayer::releasePreviewDialog(const QUuid &a_uid)
{
if(mainUi->m_pPreviewDialogs.contains(a_uid))
{
mainUi->m_pPreviewDialogs[a_uid]->close();
if(mainUi->m_pPreviewDialogs[a_uid] != nullptr)
{
mainUi->m_pPreviewDialogs[a_uid]->close();
}
}
}

Expand Down
10 changes: 8 additions & 2 deletions tools/std_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ void StdManager::releaseStdWatch(QUuid a_uid)

if(g_pStdWatch.contains(a_uid))
{
g_pStdWatch[a_uid]->close();
if(g_pStdWatch[a_uid] != nullptr)
{
g_pStdWatch[a_uid]->close();
}
g_pStdWatch[a_uid] = nullptr;
g_pStdWatch.remove(a_uid);
}
Expand All @@ -43,6 +46,9 @@ void StdManager::releaseStdWatchAll(void)
continue;
}
}
g_pStdWatch[i.key()]->close();
if(g_pStdWatch[i.key()] != nullptr)
{
g_pStdWatch[i.key()]->close();
}
}
}

0 comments on commit edde428

Please sign in to comment.