Fix UB in closing chat across all windows.
This commit is contained in:
parent
e01910ac68
commit
aa674a0ea5
|
@ -1205,11 +1205,9 @@ void Application::closeWindow(not_null<Window::Controller*> window) {
|
||||||
|
|
||||||
void Application::closeChatFromWindows(not_null<PeerData*> peer) {
|
void Application::closeChatFromWindows(not_null<PeerData*> peer) {
|
||||||
for (const auto &[history, window] : _secondaryWindows) {
|
for (const auto &[history, window] : _secondaryWindows) {
|
||||||
if (!window) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (history->peer == peer) {
|
if (history->peer == peer) {
|
||||||
closeWindow(window.get());
|
closeWindow(window.get());
|
||||||
|
break;
|
||||||
} else if (const auto session = window->sessionController()) {
|
} else if (const auto session = window->sessionController()) {
|
||||||
if (session->activeChatCurrent().peer() == peer) {
|
if (session->activeChatCurrent().peer() == peer) {
|
||||||
session->showPeerHistory(
|
session->showPeerHistory(
|
||||||
|
|
Loading…
Reference in New Issue