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:
parent
e11352ecce
commit
e606d3cb55
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user