LongPressGestureRecognizer::~LongPressGestureRecognizer()
{
+ if( mTimerId != 0 && ThreadLocalStorage::Created() )
+ {
+ Dali::Integration::PlatformAbstraction& platformAbstraction = ThreadLocalStorage::Get().GetPlatformAbstraction();
+ platformAbstraction.CancelTimer(mTimerId);
+ }
}
void LongPressGestureRecognizer::SendEvent(const Integration::TouchEvent& event)
mTouchTime = event.time;
+ if( mTimerId != 0 )
+ {
+ platformAbstraction.CancelTimer(mTimerId);
+ }
mTimerId = platformAbstraction.StartTimer( mMinimumHoldingTime, MakeCallback( this, &LongPressGestureRecognizer::TimerCallback ) );
// A long press gesture may be possible, tell Core about this and change state to Touched.
EmitGesture( Gesture::Cancelled );
mTouchPositions.clear();
platformAbstraction.CancelTimer(mTimerId);
+ mTimerId = 0;
mState = Failed;
break;
}
EmitGesture( Gesture::Cancelled );
mTouchPositions.clear();
platformAbstraction.CancelTimer(mTimerId);
+ mTimerId = 0;
mState = ( pointCount == 1 ) ? Clear : Failed; // Change state to Clear if only one point, Failed otherwise.
endLoop = true;
break;
// We have moved more than the allowable motion for a long press gesture. Inform Core and change state to Failed.
EmitGesture( Gesture::Cancelled );
platformAbstraction.CancelTimer(mTimerId);
+ mTimerId = 0;
mState = Failed;
endLoop = true;
}
mState = Finished;
+ mTimerId = 0;
+
return false;
}