tst_QLockFile: simulate a crash better
Instead of leaking the QLockFile instance, which causes leak-checkers to emit false positives, simply call exit(), which doesn't run the destructors, yet doesn't lead to leak-checker warnings. Change-Id: Ia61010671e5218ae412e2bcf873e66255a2c5a99 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
d7fa2d060a
commit
4560ce4ec6
@ -50,10 +50,10 @@ int main(int argc, char *argv[])
|
||||
option = QString::fromLocal8Bit(argv[2]);
|
||||
|
||||
if (option == "-crash") {
|
||||
QLockFile *lockFile = new QLockFile(lockName);
|
||||
lockFile->lock();
|
||||
// leak the lockFile on purpose, so that the lock remains!
|
||||
return 0;
|
||||
QLockFile lockFile(lockName);
|
||||
lockFile.lock();
|
||||
// exit on purpose, so that the lock remains!
|
||||
exit(0);
|
||||
} else if (option == "-busy") {
|
||||
QLockFile lockFile(lockName);
|
||||
lockFile.lock();
|
||||
|
Loading…
Reference in New Issue
Block a user