From ee2ba62966dd048e642cf48d4fc8499884f041a9 Mon Sep 17 00:00:00 2001 From: hyunho Date: Fri, 13 Mar 2020 13:18:23 +0900 Subject: [PATCH] Remove timer when the impl object is destroyed Change-Id: I0e0268a4730ed4e312312ec5ddad4368904f2271 Signed-off-by: hyunho --- screen_connector_remote_surface/remote_surface.cc | 4 ++++ screen_connector_remote_surface/remote_surface_implementation.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/screen_connector_remote_surface/remote_surface.cc b/screen_connector_remote_surface/remote_surface.cc index ed472b1..c277b7e 100644 --- a/screen_connector_remote_surface/remote_surface.cc +++ b/screen_connector_remote_surface/remote_surface.cc @@ -152,6 +152,10 @@ RemoteSurface::~RemoteSurface() = default; RemoteSurface::RemoteSurface(RemoteSurface&&) noexcept = default; RemoteSurface& RemoteSurface::operator=(RemoteSurface&&) noexcept = default; +RemoteSurface::Impl::~Impl() { + ClearResumingTimer(); +} + void RemoteSurface::Impl::ClearResumingTimer() { if (resuming_timer_ > 0) { g_source_remove(resuming_timer_); diff --git a/screen_connector_remote_surface/remote_surface_implementation.h b/screen_connector_remote_surface/remote_surface_implementation.h index b83b133..af56724 100644 --- a/screen_connector_remote_surface/remote_surface_implementation.h +++ b/screen_connector_remote_surface/remote_surface_implementation.h @@ -46,7 +46,7 @@ class RemoteSurface::Impl : AulHandle::IEventListener, ITRS::IEventListener { uint32_t size, uint32_t time) override; void OnInputFilterChanged(uint32_t event_filter) override; - virtual ~Impl() = default; + virtual ~Impl(); private: friend class RemoteSurface; -- 2.7.4