Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
c83f3cdb
Commit
c83f3cdb
authored
Jan 01, 2021
by
Jean-Baptiste Mardelle
Browse files
Fix crash check lockfile
parent
b0daadb1
Pipeline
#45999
passed with stage
in 10 minutes and 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/core.cpp
View file @
c83f3cdb
...
...
@@ -36,7 +36,6 @@ the Free Software Foundation, either version 3 of the License, or
#include <QCoreApplication>
#include <QInputDialog>
#include <QDir>
#include <QLockFile>
#include <QQuickStyle>
#include <locale>
#ifdef Q_OS_MAC
...
...
@@ -92,12 +91,17 @@ bool Core::build(bool isAppImage, const QString &MltPath)
qRegisterMetaType
<
requestClipInfo
>
(
"requestClipInfo"
);
// Check if we had a crash
Q
Lock
File
lockFile
(
QDir
::
temp
().
absoluteFilePath
(
QStringLiteral
(
"kdenlivelock"
)));
if
(
!
lockFile
.
tryLock
())
{
QFile
lockFile
(
QDir
::
temp
().
absoluteFilePath
(
QStringLiteral
(
"kdenlivelock"
)));
if
(
lockFile
.
exists
())
{
// a previous instance crashed, propose to delete config files
if
(
KMessageBox
::
questionYesNo
(
QApplication
::
activeWindow
(),
i18n
(
"Kdenlive crashed on last startup.
\n
Do you want to reset the configuration files ?"
))
==
KMessageBox
::
Yes
)
{
return
false
;
}
}
else
{
// Create lock file
lockFile
.
open
(
QFile
::
WriteOnly
);
lockFile
.
write
(
QByteArray
());
lockFile
.
close
();
}
if
(
isAppImage
)
{
...
...
@@ -238,8 +242,8 @@ void Core::initGUI(const QUrl &Url, const QString &clipsToLoad)
QThreadPool
::
globalInstance
()
->
setMaxThreadCount
(
qMin
(
4
,
QThreadPool
::
globalInstance
()
->
maxThreadCount
()));
// Release startup crash lock file
Q
Lock
File
lockFile
(
QDir
::
temp
().
absoluteFilePath
(
QStringLiteral
(
"kdenlivelock"
)));
lockFile
.
unlock
();
QFile
lockFile
(
QDir
::
temp
().
absoluteFilePath
(
QStringLiteral
(
"kdenlivelock"
)));
lockFile
.
remove
();
}
void
Core
::
buildLumaThumbs
(
const
QStringList
&
values
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment