Open akihito104 opened 8 years ago
08-30 16:04:06.488 13070-13070/com.freshdigitable.udonroad W/System.err: java.lang.IllegalStateException: Unbalanced enter/exit 08-30 16:04:06.514 13070-13070/com.freshdigitable.udonroad W/System.err: at okio.AsyncTimeout.enter(AsyncTimeout.java:72) 08-30 16:04:06.514 13070-13070/com.freshdigitable.udonroad W/System.err: at okio.AsyncTimeout$2.read(AsyncTimeout.java:236) 08-30 16:04:06.514 13070-13070/com.freshdigitable.udonroad W/System.err: at okio.RealBufferedSource.indexOf(RealBufferedSource.java:325) 08-30 16:04:06.514 13070-13070/com.freshdigitable.udonroad W/System.err: at okio.RealBufferedSource.indexOf(RealBufferedSource.java:314) 08-30 16:04:06.514 13070-13070/com.freshdigitable.udonroad W/System.err: at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210) 08-30 16:04:06.514 13070-13070/com.freshdigitable.udonroad W/System.err: at com.squareup.okhttp.internal.http.HttpConnection$ChunkedSource.readChunkSize(HttpConnection.java:476) 08-30 16:04:06.514 13070-13070/com.freshdigitable.udonroad W/System.err: at com.squareup.okhttp.internal.http.HttpConnection$ChunkedSource.read(HttpConnection.java:460) 08-30 16:04:06.514 13070-13070/com.freshdigitable.udonroad W/System.err: at com.squareup.okhttp.internal.Util.skipAll(Util.java:176) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at com.squareup.okhttp.internal.Util.discard(Util.java:158) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at com.squareup.okhttp.internal.http.HttpConnection$ChunkedSource.close(HttpConnection.java:499) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at okio.RealBufferedSource.close(RealBufferedSource.java:434) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at okio.RealBufferedSource$1.close(RealBufferedSource.java:422) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at java.io.FilterInputStream.close(FilterInputStream.java:64) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at java.util.zip.InflaterInputStream.close(InflaterInputStream.java:252) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at java.util.zip.GZIPInputStream.close(GZIPInputStream.java:125) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at twitter4j.StatusStreamBase.close(StatusStreamBase.java:334) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at twitter4j.TwitterStreamImpl$TwitterStreamConsumer.close(TwitterStreamImpl.java:683) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at twitter4j.TwitterStreamImpl.cleanUp(TwitterStreamImpl.java:385) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at twitter4j.TwitterStreamImpl.shutdown(TwitterStreamImpl.java:392) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at com.freshdigitable.udonroad.TwitterStreamApi.disconnectStreamListener(TwitterStreamApi.java:52) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at com.freshdigitable.udonroad.UserStreamUtil.disconnect(UserStreamUtil.java:82) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at com.freshdigitable.udonroad.MainActivity.onDestroy(MainActivity.java:343) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at android.app.Activity.performDestroy(Activity.java:6464) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1143) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3991) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4022) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at android.app.ActivityThread.access$1700(ActivityThread.java:169) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1485) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102) 08-30 16:04:06.518 13070-13070/com.freshdigitable.udonroad W/System.err: at android.os.Looper.loop(Looper.java:148) 08-30 16:04:06.519 13070-13070/com.freshdigitable.udonroad W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5595) 08-30 16:04:06.519 13070-13070/com.freshdigitable.udonroad W/System.err: at java.lang.reflect.Method.invoke(Native Method) 08-30 16:04:06.519 13070-13070/com.freshdigitable.udonroad W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:734) 08-30 16:04:06.519 13070-13070/com.freshdigitable.udonroad W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624) 08-30 16:04:06.547 13070-13070/com.freshdigitable.udonroad W/TwitterStreamImpl: Unbalanced enter/exit
別のスレッドからリソースを閉じたければ、先にCall.cancel()を呼んで今やっている処理をインタラプトして止めなければならないとのこと。
Call.cancel()
いまの実装(4.0.5)では逆になっている。
refs: https://github.com/yusuke/twitter4j/blob/4ebca9da71b271775624b11b5197af99a57bf175/twitter4j-stream/src/main/java/twitter4j/StatusStreamBase.java#L333