Browse Source

Turn static variable into class member

adaptive-webui-19844
Chocobo1 2 years ago
parent
commit
7eaaa8f92a
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 4
      src/app/application.cpp
  2. 2
      src/app/application.h

4
src/app/application.cpp

@ -43,7 +43,6 @@ @@ -43,7 +43,6 @@
#include <sys/resource.h>
#endif
#include <QAtomicInt>
#include <QByteArray>
#include <QDebug>
#include <QLibraryInfo>
@ -808,8 +807,7 @@ void Application::applyMemoryWorkingSetLimit() @@ -808,8 +807,7 @@ void Application::applyMemoryWorkingSetLimit()
void Application::cleanup()
{
// cleanup() can be called multiple times during shutdown. We only need it once.
static QAtomicInt alreadyDone;
if (!alreadyDone.testAndSetAcquire(0, 1))
if (!m_isCleanupRun.testAndSetAcquire(0, 1))
return;
#ifndef DISABLE_GUI

2
src/app/application.h

@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
#pragma once
#include <QtGlobal>
#include <QAtomicInt>
#include <QCoreApplication>
#include <QPointer>
#include <QStringList>
@ -145,6 +146,7 @@ private: @@ -145,6 +146,7 @@ private:
ApplicationInstanceManager *m_instanceManager = nullptr;
bool m_running = false;
QAtomicInt m_isCleanupRun;
ShutdownDialogAction m_shutdownAct;
QBtCommandLineParameters m_commandLineArgs;

Loading…
Cancel
Save