Fix shutdown

This commit is contained in:
Paul Rouget 2019-07-26 18:25:04 +02:00
parent 449881f566
commit c6a2f6eb05
3 changed files with 7 additions and 4 deletions

View file

@ -40,7 +40,7 @@ void BrowserPage::Shutdown() {
log("Waiting for Servo to shutdown");
::WaitForSingleObject(hEvent, INFINITE);
StopRenderLoop();
mServo.reset(); // will call servo::deinit
mServo.reset();
}
}
}
@ -168,6 +168,7 @@ void BrowserPage::Loop(cancellation_token cancel) {
mServo->PerformUpdates();
}
log("Leaving loop");
mServo->DeInit();
cancel_current_task();
} // namespace winrt::ServoApp::implementation
@ -188,6 +189,7 @@ void BrowserPage::StartRenderLoop() {
void BrowserPage::StopRenderLoop() {
if (IsLoopRunning()) {
mLoopCancel.cancel();
WakeUp();
mLoopTask->wait();
mLoopTask.reset();
}