aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/copilot/copilotplugin.cpp
diff options
context:
space:
mode:
authorMarcus Tillmanns <[email protected]>2023-02-27 11:11:02 +0100
committerMarcus Tillmanns <[email protected]>2023-02-27 11:01:28 +0000
commit4c251486e1b4f3a4fb87b51b519ef1abc30de1eb (patch)
tree22e8ee580ea6790d75f878a324f39e885bd930ab /src/plugins/copilot/copilotplugin.cpp
parent3e73fe302e65af7860f47ec22153e2c0479f99ff (diff)
Copilot: Various coverity warning fixes
Change-Id: I5d86606611369f4bc11f9f21e308139bba700eb0 Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/plugins/copilot/copilotplugin.cpp')
-rw-r--r--src/plugins/copilot/copilotplugin.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/copilot/copilotplugin.cpp b/src/plugins/copilot/copilotplugin.cpp
index ff2c449088f..910bfa33b7b 100644
--- a/src/plugins/copilot/copilotplugin.cpp
+++ b/src/plugins/copilot/copilotplugin.cpp
@@ -14,12 +14,22 @@ using namespace Utils;
namespace Copilot {
namespace Internal {
+CopilotPlugin::~CopilotPlugin()
+{
+ if (m_client)
+ m_client->shutdown();
+
+ m_client = nullptr;
+}
+
void CopilotPlugin::initialize()
{
CopilotSettings::instance().readSettings(Core::ICore::settings());
m_client = new CopilotClient();
+ connect(m_client, &CopilotClient::finished, this, [this]() { m_client = nullptr; });
+
connect(&CopilotSettings::instance(), &CopilotSettings::applied, this, [this]() {
if (m_client)
m_client->shutdown();