mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #23866 - paulrouget:shutdown, r=jdm
Hololens: Fix shutdown Fixes #23859 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23866) <!-- Reviewable:end -->
This commit is contained in:
commit
f78dd6142e
3 changed files with 7 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ Servo::Servo(GLsizei width, GLsizei height, ServoDelegate &aDelegate)
|
|||
init_with_egl(o, &wakeup, c);
|
||||
}
|
||||
|
||||
Servo::~Servo() { capi::deinit(); }
|
||||
Servo::~Servo() { sServo = nullptr; }
|
||||
|
||||
std::wstring char2w(const char *c_str) {
|
||||
auto str = std::string(c_str);
|
||||
|
@ -71,4 +71,4 @@ std::wstring char2w(const char *c_str) {
|
|||
return str2;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
} // namespace servo
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
virtual void OnAnimatingChanged(bool) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~ServoDelegate(){log("A1");};
|
||||
virtual ~ServoDelegate(){};
|
||||
};
|
||||
|
||||
class Servo {
|
||||
|
@ -43,6 +43,7 @@ public:
|
|||
ServoDelegate &Delegate() { return mDelegate; }
|
||||
|
||||
void PerformUpdates() { capi::perform_updates(); }
|
||||
void DeInit() { capi::deinit(); }
|
||||
void RequestShutdown() { capi::request_shutdown(); }
|
||||
void SetBatchMode(bool mode) { capi::set_batch_mode(mode); }
|
||||
void GoForward() { capi::go_forward(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue