[Title] Fix a bug where timer is not canceled after writing socket. 91/11291/1
authorshingil.kang <shingil.kang@samsung.com>
Wed, 23 Oct 2013 17:07:20 +0000 (02:07 +0900)
committershingil.kang <shingil.kang@samsung.com>
Thu, 24 Oct 2013 01:29:57 +0000 (10:29 +0900)
[Desc.]
[Issue]

Change-Id: Ifc88e28d9844a8a9aa9085518f26c62c8a569b4f
Signed-off-by: shingil.kang <shingil.kang@samsung.com>
org.tizen.common.sdblib/src/org/tizen/sdblib/SdbHelper.java

index d6e9fe6..6dea5ce 100755 (executable)
@@ -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");