有个概率性Bug
huangjinhong opened this issue · 2 comments
这里有个概率性Bug,错误日志如下:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.HandlerThread.quit()' on a null object reference
at cn.kejin.ximageview.BitmapManager.onDestroy(BitmapManager.java:210)
at cn.kejin.ximageview.XImageView.onDetachedFromWindow(XImageView.java:211)
at android.view.View.dispatchDetachedFromWindow(View.java:15846)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3372)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4950)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4923)
at android.view.ViewGroup.removeView(ViewGroup.java:4854)
at android.support.v4.view.ViewPager.removeView(ViewPager.java:1359)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1178)
at android.support.v4.app.FragmentManagerImpl.detachFragment(FragmentManagerImpl.java:1415)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:723)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1624)
at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManagerImpl.java:570)
at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1106)
at android.support.v4.view.ViewPager.populate(ViewPager.java:952)
at android.support.v4.view.ViewPager$3.run(ViewPager.java:251)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
at android.view.Choreographer.doCallbacks(Choreographer.java:695)
at android.view.Choreographer.doFrame(Choreographer.java:628)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
嗯嗯,这个是因为在destroy() 的时候没有判断为空!
最近工作比较多,本来想重构的,一直没时间,现在还只重构了一半!
项目已经更新,这个问题已经修复,欢迎使用指正,谢谢!