Skip to content
Commit bdabd396 authored by Jiwon Kim's avatar Jiwon Kim
Browse files

Fixed Handler Leak on DistanceClassifier



A VelocityTracker object is not recycled in case of motionEvents.size()<3 at calculateDistances function.

private DistanceVectors calculateDistances() {
    // This code assumes that there will be no missed DOWN or UP events.
    VelocityTracker velocityTracker = VelocityTracker.obtain();
...
    if (motionEvents.size() < 3) {
        logDebug("Only " + motionEvents.size() + " motion events recorded.");
        return new DistanceVectors(0, 0, 0, 0);
	}
...
}

Test: Manual

Signed-off-by: default avatarJiwon Kim <jiwon88.kim@samsung.com>
Change-Id: Ifca0c25411f56a4de79d89d262d2b4e61045a8ed
parent 5e3a035a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment