Skip to content

Commit

Permalink
Fixed a crash when switching spotify accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilInTheGaps committed Nov 6, 2023
1 parent d6306b6 commit 5397d7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/services/spotify/clients/librespotcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ static constexpr int PROCESS_TERMINATE_TIMEOUT_MS = 1000;
LibrespotController::LibrespotController(QObject *parent)
: AbstractSpotifyClientController(parent, gmLibrespotController())
{
m_hasAuthenticated = std::make_unique<QPromise<bool>>();
initProcess();
}

Expand Down Expand Up @@ -67,6 +66,7 @@ auto LibrespotController::start() -> QFuture<bool>
}

qCDebug(gmLibrespotController()) << QString(info);
m_hasAuthenticated = std::make_unique<QPromise<bool>>();
m_hasAuthenticated->start();

const auto args = getLibrespotArgs(username);
Expand Down
2 changes: 1 addition & 1 deletion src/services/spotify/clients/librespotcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class LibrespotController : public AbstractSpotifyClientController
auto getLibrespotInfo() -> LibrespotInfo;
void printOutputAndUpdateStatus(const QString &line);

std::unique_ptr<QPromise<bool>> m_hasAuthenticated;
std::unique_ptr<QPromise<bool>> m_hasAuthenticated = nullptr;

private slots:
void onLibrespotFinished(int exitCode, QProcess::ExitStatus exitStatus);
Expand Down

0 comments on commit 5397d7f

Please sign in to comment.