mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 02:01:40 -05:00
Fixed crash from touchbar after logout.
This commit is contained in:
parent
26ec440a13
commit
ab16c88473
2 changed files with 12 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue