diff options
-rw-r--r-- | support/hololens/ServoApp/BrowserPage.cpp | 4 | ||||
-rw-r--r-- | support/hololens/ServoApp/Servo.cpp | 4 | ||||
-rw-r--r-- | support/hololens/ServoApp/Servo.h | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/support/hololens/ServoApp/BrowserPage.cpp b/support/hololens/ServoApp/BrowserPage.cpp index c6fe3d9b969..1b4844d40bc 100644 --- a/support/hololens/ServoApp/BrowserPage.cpp +++ b/support/hololens/ServoApp/BrowserPage.cpp @@ -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(); } diff --git a/support/hololens/ServoApp/Servo.cpp b/support/hololens/ServoApp/Servo.cpp index 4283b66bc11..5cb35650c72 100644 --- a/support/hololens/ServoApp/Servo.cpp +++ b/support/hololens/ServoApp/Servo.cpp @@ -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 diff --git a/support/hololens/ServoApp/Servo.h b/support/hololens/ServoApp/Servo.h index 17f283cdf56..d505d46b493 100644 --- a/support/hololens/ServoApp/Servo.h +++ b/support/hololens/ServoApp/Servo.h @@ -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(); } |