Fixed crash from touchbar after logout.

This commit is contained in:
23rd 2019-05-28 01:28:49 +03:00
parent 26ec440a13
commit ab16c88473
2 changed files with 12 additions and 3 deletions

View file

@ -113,7 +113,7 @@ public:
bool clipboardHasText();
TouchBar *_touchBar = nullptr;
TouchBar *_touchBar = nil;
~Private();
@ -424,8 +424,9 @@ void MainWindow::initTouchBar() {
} else {
if (_private->_touchBar) {
[_private->_touchBar setTouchBar:Platform::TouchBarType::None];
[_private->_touchBar release];
}
_private->_touchBar = nullptr;
_private->_touchBar = nil;
}
});
}

View file

@ -448,7 +448,8 @@ void PaintUnreadBadge(Painter &p, PeerData *peer) {
NSStackView *stackView = [[NSStackView alloc] init];
for (auto i = kArchiveId; i <= Global::PinnedDialogsCountMax(); i++) {
PinnedDialogButton *button = [[PinnedDialogButton alloc] init:i];
PinnedDialogButton *button =
[[[PinnedDialogButton alloc] init:i] autorelease];
[_mainPinnedButtons addObject:button];
if (i == kArchiveId) {
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