From 61612dda08f2ccbc552c798b6041e1e4973cb997 Mon Sep 17 00:00:00 2001 From: "shingil.kang" Date: Thu, 24 Oct 2013 02:07:20 +0900 Subject: [PATCH] [Title] Fix a bug where timer is not canceled after writing socket. [Desc.] [Issue] Change-Id: Ifc88e28d9844a8a9aa9085518f26c62c8a569b4f Signed-off-by: shingil.kang --- org.tizen.common.sdblib/src/org/tizen/sdblib/SdbHelper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.tizen.common.sdblib/src/org/tizen/sdblib/SdbHelper.java b/org.tizen.common.sdblib/src/org/tizen/sdblib/SdbHelper.java index d6e9fe6..6dea5ce 100755 --- a/org.tizen.common.sdblib/src/org/tizen/sdblib/SdbHelper.java +++ b/org.tizen.common.sdblib/src/org/tizen/sdblib/SdbHelper.java @@ -437,8 +437,9 @@ public class SdbHelper { { final ByteBuffer buf = ByteBuffer.wrap(data, 0, length < 0 ? data.length : length ); final AtomicBoolean running = new AtomicBoolean( true ); + Timer timer = null; if ( 0 < timeout ) { - final Timer timer = new Timer(); + timer = new Timer(); timer.schedule( new TimerTask() { @Override @@ -464,6 +465,8 @@ public class SdbHelper { } if ( buf.position() == buf.limit() ) { + if(timer != null) + timer.cancel(); return ; } Log.d("sdb", "write: Timeout"); -- 2.7.4