A couple of rare crashes fixed.

This commit is contained in:
John Preston 2016-07-29 17:33:49 +01:00
parent 4b9b9e2e13
commit 0291888c01
3 changed files with 6 additions and 3 deletions

View File

@ -3742,7 +3742,10 @@ int32 MainWidget::dlgsWidth() const {
MainWidget::~MainWidget() {
if (App::main() == this) _history->showHistory(0, 0);
delete _hider;
if (HistoryHider *hider = _hider) {
_hider = nullptr;
delete hider;
}
MTP::clearGlobalHandlers();
if (App::wnd()) App::wnd()->noMain(this);

View File

@ -59,8 +59,8 @@ void Controller::onSeekProgress(float64 progress) {
auto positionMs = snap(static_cast<int64>(progress * _lastDurationMs), 0LL, _lastDurationMs);
if (_seekPositionMs != positionMs) {
_seekPositionMs = positionMs;
emit seekProgress(positionMs);
refreshTimeTexts();
emit seekProgress(positionMs); // This may destroy Controller.
}
}

View File

@ -122,8 +122,8 @@ void Playback::mouseMoveEvent(QMouseEvent *e) {
void Playback::mousePressEvent(QMouseEvent *e) {
_mouseDown = true;
_downProgress = snap(e->pos().x() / float64(width()), 0., 1.);
emit seekProgress(_downProgress);
update();
emit seekProgress(_downProgress); // This may destroy Playback.
}
void Playback::mouseReleaseEvent(QMouseEvent *e) {