forked from qt-creator/qt-creator
CoPilot: Fix leak in authwidget
Also fixes a crash when the state check returns after the widget was already deleted. Change-Id: I04256e6ba686469f18ebdb75c73e12cecf330bed Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -48,6 +48,12 @@ AuthWidget::AuthWidget(QWidget *parent)
|
||||
});
|
||||
}
|
||||
|
||||
AuthWidget::~AuthWidget()
|
||||
{
|
||||
if (m_client)
|
||||
LanguageClientManager::shutdownClient(m_client);
|
||||
}
|
||||
|
||||
void AuthWidget::setState(const QString &buttonText, bool working)
|
||||
{
|
||||
m_button->setText(buttonText);
|
||||
|
||||
@@ -25,6 +25,8 @@ class AuthWidget : public QWidget
|
||||
|
||||
public:
|
||||
explicit AuthWidget(QWidget *parent = nullptr);
|
||||
~AuthWidget() override;
|
||||
|
||||
void updateClient(const Utils::FilePath &nodeJs, const Utils::FilePath &agent);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user