diff --git a/android/manifest b/android/manifest index 416cb18..821cc32 100644 --- a/android/manifest +++ b/android/manifest @@ -2,7 +2,7 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 5.0.1 +version: 5.0.2 apiversion: 4 architectures: arm64-v8a armeabi-v7a x86 x86_64 description: av.imageview diff --git a/android/src/av/imageview/AvImageView.java b/android/src/av/imageview/AvImageView.java index 726fb02..159c85a 100644 --- a/android/src/av/imageview/AvImageView.java +++ b/android/src/av/imageview/AvImageView.java @@ -92,7 +92,7 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP @Override public void release() { Activity act = TiApplication.getAppCurrentActivity(); - if (!act.isFinishing() && !act.isDestroyed()) { + if (act != null && !act.isFinishing() && !act.isDestroyed()) { Glide.with(act).clear(this.imageView); } diff --git a/android/src/av/imageview/ImageViewProxy.java b/android/src/av/imageview/ImageViewProxy.java index 327f8d3..69c654f 100644 --- a/android/src/av/imageview/ImageViewProxy.java +++ b/android/src/av/imageview/ImageViewProxy.java @@ -34,6 +34,13 @@ public TiUIView createView(Activity activity) { return view; } + @Override + public void onDestroy(Activity activity) { + super.onDestroy(activity); + + this.activity = null; + } + protected AvImageView getView() { return (AvImageView) this.getOrCreateView(); }