mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 14:08:41 +00:00
Fixed crash from touchbar after logout.
This commit is contained in:
@@ -113,7 +113,7 @@ public:
|
|||||||
|
|
||||||
bool clipboardHasText();
|
bool clipboardHasText();
|
||||||
|
|
||||||
TouchBar *_touchBar = nullptr;
|
TouchBar *_touchBar = nil;
|
||||||
|
|
||||||
~Private();
|
~Private();
|
||||||
|
|
||||||
@@ -424,8 +424,9 @@ void MainWindow::initTouchBar() {
|
|||||||
} else {
|
} else {
|
||||||
if (_private->_touchBar) {
|
if (_private->_touchBar) {
|
||||||
[_private->_touchBar setTouchBar:Platform::TouchBarType::None];
|
[_private->_touchBar setTouchBar:Platform::TouchBarType::None];
|
||||||
|
[_private->_touchBar release];
|
||||||
}
|
}
|
||||||
_private->_touchBar = nullptr;
|
_private->_touchBar = nil;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -448,7 +448,8 @@ void PaintUnreadBadge(Painter &p, PeerData *peer) {
|
|||||||
NSStackView *stackView = [[NSStackView alloc] init];
|
NSStackView *stackView = [[NSStackView alloc] init];
|
||||||
|
|
||||||
for (auto i = kArchiveId; i <= Global::PinnedDialogsCountMax(); i++) {
|
for (auto i = kArchiveId; i <= Global::PinnedDialogsCountMax(); i++) {
|
||||||
PinnedDialogButton *button = [[PinnedDialogButton alloc] init:i];
|
PinnedDialogButton *button =
|
||||||
|
[[[PinnedDialogButton alloc] init:i] autorelease];
|
||||||
[_mainPinnedButtons addObject:button];
|
[_mainPinnedButtons addObject:button];
|
||||||
if (i == kArchiveId) {
|
if (i == kArchiveId) {
|
||||||
button.isDeletedFromView = true;
|
button.isDeletedFromView = true;
|
||||||
@@ -686,4 +687,11 @@ void PaintUnreadBadge(Painter &p, PeerData *peer) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(void)dealloc {
|
||||||
|
for (PinnedDialogButton *button in _mainPinnedButtons) {
|
||||||
|
[button release];
|
||||||
|
}
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Reference in New Issue
Block a user