1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(group): Fix crash on group quit

Fix 'GroupWidget' removing
This commit is contained in:
Diadlo 2017-08-19 16:18:43 +03:00
parent e11352ecce
commit e606d3cb55
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
3 changed files with 9 additions and 1 deletions

View File

@ -296,6 +296,12 @@ void FriendListWidget::addFriendWidget(FriendWidget* w, Status s, int circleInde
circleWidget->addFriendWidget(w, s);
}
void FriendListWidget::removeGroupWidget(GroupWidget* w)
{
groupLayout.removeSortedWidget(w);
w->deleteLater();
}
void FriendListWidget::removeFriendWidget(FriendWidget* w)
{
const Friend* contact = w->getFriend();

View File

@ -51,6 +51,7 @@ public:
void addGroupWidget(GroupWidget* widget);
void addFriendWidget(FriendWidget* w, Status s, int circleIndex);
void removeGroupWidget(GroupWidget* w);
void removeFriendWidget(FriendWidget* w);
void addCircleWidget(int id);
void addCircleWidget(FriendWidget* widget = nullptr);

View File

@ -1791,7 +1791,8 @@ void Widget::removeGroup(Group* g, bool fake)
groupWidgets.remove(groupId);
Nexus::getCore()->removeGroup(groupId, fake);
delete widget;
contactListWidget->removeGroupWidget(widget);
delete g;
if (contentLayout && contentLayout->mainHead->layout()->isEmpty()) {
onAddClicked();