Fix crash that can occur when changing channels (#3799)
The signal that handled the splitinput completer never disconnected, so if it closed it would access bad memory
This commit is contained in:
@@ -40,9 +40,9 @@ SplitInput::SplitInput(Split *_chatWidget)
|
||||
new QCompleter(&this->split_->getChannel().get()->completionModel);
|
||||
this->ui_.textEdit->setCompleter(completer);
|
||||
|
||||
this->split_->channelChanged.connect([this] {
|
||||
auto completer =
|
||||
new QCompleter(&this->split_->getChannel()->completionModel);
|
||||
this->signalHolder_.managedConnect(this->split_->channelChanged, [this] {
|
||||
auto channel = this->split_->getChannel();
|
||||
auto completer = new QCompleter(&channel->completionModel);
|
||||
this->ui_.textEdit->setCompleter(completer);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user