Kaydet (Commit) 50d961eb authored tarafından Michael Meeks's avatar Michael Meeks

vcl timers: avoid crash initializing too early.

We need the default instance created first.

Change-Id: I95f51e9ec5d9827f2b1b53bcadb1f43c9e637edd
üst 22cd725f
......@@ -35,7 +35,7 @@ protected:
virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) SAL_OVERRIDE;
private:
void InitSystemTimer();
static void InitSystemTimer();
public:
Timer();
......
......@@ -27,6 +27,8 @@
void Timer::ImplStartTimer( ImplSVData* pSVData, sal_uInt64 nMS )
{
InitSystemTimer();
if ( !nMS )
nMS = 1;
......@@ -101,7 +103,6 @@ Timer::Timer() : Scheduler()
mnTimeout = 1;
mbAuto = false;
mePriority = SchedulerPriority::HIGHEST;
InitSystemTimer();
}
Timer::Timer( const Timer& rTimer ) : Scheduler(rTimer)
......@@ -109,7 +110,6 @@ Timer::Timer( const Timer& rTimer ) : Scheduler(rTimer)
mnTimeout = rTimer.mnTimeout;
mbAuto = rTimer.mbAuto;
maTimeoutHdl = rTimer.maTimeoutHdl;
InitSystemTimer();
}
void Timer::Invoke()
......@@ -122,7 +122,6 @@ void Timer::Start()
Scheduler::Start();
ImplSVData* pSVData = ImplGetSVData();
assert( pSVData->mpSalTimer != NULL );
if ( mnTimeout < pSVData->mnTimerPeriod )
Timer::ImplStartTimer( pSVData, mnTimeout );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment