mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-05 23:01:19 +00:00
A couple of rare crashes fixed.
This commit is contained in:
parent
4b9b9e2e13
commit
0291888c01
@ -3742,7 +3742,10 @@ int32 MainWidget::dlgsWidth() const {
|
|||||||
MainWidget::~MainWidget() {
|
MainWidget::~MainWidget() {
|
||||||
if (App::main() == this) _history->showHistory(0, 0);
|
if (App::main() == this) _history->showHistory(0, 0);
|
||||||
|
|
||||||
delete _hider;
|
if (HistoryHider *hider = _hider) {
|
||||||
|
_hider = nullptr;
|
||||||
|
delete hider;
|
||||||
|
}
|
||||||
MTP::clearGlobalHandlers();
|
MTP::clearGlobalHandlers();
|
||||||
|
|
||||||
if (App::wnd()) App::wnd()->noMain(this);
|
if (App::wnd()) App::wnd()->noMain(this);
|
||||||
|
@ -59,8 +59,8 @@ void Controller::onSeekProgress(float64 progress) {
|
|||||||
auto positionMs = snap(static_cast<int64>(progress * _lastDurationMs), 0LL, _lastDurationMs);
|
auto positionMs = snap(static_cast<int64>(progress * _lastDurationMs), 0LL, _lastDurationMs);
|
||||||
if (_seekPositionMs != positionMs) {
|
if (_seekPositionMs != positionMs) {
|
||||||
_seekPositionMs = positionMs;
|
_seekPositionMs = positionMs;
|
||||||
emit seekProgress(positionMs);
|
|
||||||
refreshTimeTexts();
|
refreshTimeTexts();
|
||||||
|
emit seekProgress(positionMs); // This may destroy Controller.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,8 +122,8 @@ void Playback::mouseMoveEvent(QMouseEvent *e) {
|
|||||||
void Playback::mousePressEvent(QMouseEvent *e) {
|
void Playback::mousePressEvent(QMouseEvent *e) {
|
||||||
_mouseDown = true;
|
_mouseDown = true;
|
||||||
_downProgress = snap(e->pos().x() / float64(width()), 0., 1.);
|
_downProgress = snap(e->pos().x() / float64(width()), 0., 1.);
|
||||||
emit seekProgress(_downProgress);
|
|
||||||
update();
|
update();
|
||||||
|
emit seekProgress(_downProgress); // This may destroy Playback.
|
||||||
}
|
}
|
||||||
|
|
||||||
void Playback::mouseReleaseEvent(QMouseEvent *e) {
|
void Playback::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user