Ensure we disconnect from signals on exit in SplitHeader
This commit is contained in:
@@ -136,9 +136,9 @@ void SplitHeader::initializeChannelSignals()
|
|||||||
TwitchChannel *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
|
TwitchChannel *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
|
||||||
|
|
||||||
if (twitchChannel) {
|
if (twitchChannel) {
|
||||||
twitchChannel->updateLiveInfo.connect([this]() {
|
this->managedConnections.emplace_back(twitchChannel->updateLiveInfo.connect([this]() {
|
||||||
this->updateChannelText(); //
|
this->updateChannelText(); //
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <pajlada/settings/setting.hpp>
|
#include <pajlada/settings/setting.hpp>
|
||||||
|
#include <pajlada/signals/connection.hpp>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
namespace widgets {
|
namespace widgets {
|
||||||
@@ -64,6 +67,8 @@ private:
|
|||||||
QString tooltip;
|
QString tooltip;
|
||||||
bool isLive;
|
bool isLive;
|
||||||
|
|
||||||
|
std::vector<pajlada::Signals::ScopedConnection> managedConnections;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addDropdownItems(RippleEffectButton *label);
|
void addDropdownItems(RippleEffectButton *label);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user