From a60f687b5dd684260fc976c1216d65d30e77e5de Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Tue, 26 Sep 2017 19:06:51 +0200 Subject: tdf#112605 OSX refactor SalAquaTimer Drops all the static calls and variables from SalAquaTimer and moves all timer handling logic inside the class. This also fixes the leak in timerElapsed. Change-Id: Ie7a1a8fffb70b8579ec6876eed10a275d2f06d27 Reviewed-on: https://gerrit.libreoffice.org/42913 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski --- vcl/inc/osx/saltimer.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'vcl/inc') diff --git a/vcl/inc/osx/saltimer.h b/vcl/inc/osx/saltimer.h index 86964115d648..f70bd65491b8 100644 --- a/vcl/inc/osx/saltimer.h +++ b/vcl/inc/osx/saltimer.h @@ -43,6 +43,12 @@ public: class AquaSalTimer : public SalTimer { + NSTimer *m_pRunningTimer; + sal_Int32 m_nTimerStartTicks; ///< system ticks at timer start % SAL_MAX_INT32 + + void queueDispatchTimerEvent( bool bAtStart ); + void callTimerCallback(); + public: AquaSalTimer(); virtual ~AquaSalTimer() override; @@ -50,11 +56,11 @@ public: void Start( sal_uLong nMS ) override; void Stop() override; - static void handleStartTimerEvent( NSEvent* pEvent ); - static void handleDispatchTimerEvent(); + void handleStartTimerEvent( NSEvent* pEvent ); + void handleDispatchTimerEvent( NSEvent* pEvent ); + void handleTimerElapsed(); - static NSTimer* pRunningTimer; - static bool bDispatchTimer; + bool IsTimerElapsed() const; }; #endif // INCLUDED_VCL_INC_OSX_SALTIMER_H -- cgit