mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07:00
Use helper functions to construct smart pointers
This commit is contained in:
parent
ca01b049a6
commit
2157e500ef
7 changed files with 10 additions and 10 deletions
|
@ -136,7 +136,7 @@ int main(int argc, char *argv[])
|
|||
try {
|
||||
// Create Application
|
||||
const QString appId = QLatin1String("qBittorrent-") + Utils::Misc::getUserIDString();
|
||||
std::unique_ptr<Application> app(new Application(appId, argc, argv));
|
||||
auto app = std::make_unique<Application>(appId, argc, argv);
|
||||
|
||||
const QBtCommandLineParameters params = app->commandLineArgs();
|
||||
|
||||
|
@ -258,7 +258,7 @@ int main(int argc, char *argv[])
|
|||
if (params.shouldDaemonize) {
|
||||
app.reset(); // Destroy current application
|
||||
if (daemon(1, 0) == 0) {
|
||||
app.reset(new Application(appId, argc, argv));
|
||||
app = std::make_unique<Application>(appId, argc, argv);
|
||||
if (app->isRunning()) {
|
||||
// Another instance had time to start.
|
||||
return EXIT_FAILURE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue