Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional resource cleanup in RSBlur #45

Merged
merged 1 commit into from
Mar 17, 2017
Merged

Additional resource cleanup in RSBlur #45

merged 1 commit into from
Mar 17, 2017

Conversation

timusus
Copy link
Contributor

@timusus timusus commented Jun 12, 2016

When the blur is finished, the input, output, and blur are all destroyed, along with the renderscript instance.

This resolves a strictmode 'resource acquired but never released' violation:

E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.

java.lang.Throwable: Explicit termination method 'destroy' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:180)
at android.renderscript.Script.<init>(Script.java:374)
at android.renderscript.ScriptIntrinsic.<init>(ScriptIntrinsic.java:29)
at android.renderscript.ScriptIntrinsicBlur.<init>(ScriptIntrinsicBlur.java:30)
at android.renderscript.ScriptIntrinsicBlur.create(ScriptIntrinsicBlur.java:49)
at jp.wasabeef.glide.transformations.internal.RSBlur.blur(RSBlur.java:42)
at jp.wasabeef.glide.transformations.BlurTransformation.transform(BlurTransformation.java:93)
at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperTransformation.transform(GifBitmapWrapperTransformation.java:34)
at com.bumptech.glide.load.engine.DecodeJob.transform(DecodeJob.java:236)
at com.bumptech.glide.load.engine.DecodeJob.transformEncodeAndTranscode(DecodeJob.java:139)
at com.bumptech.glide.load.engine.DecodeJob.decodeFromSource(DecodeJob.java:129)
at com.bumptech.glide.load.engine.EngineRunnable.decodeFromSource(EngineRunnable.java:122)
at com.bumptech.glide.load.engine.EngineRunnable.decode(EngineRunnable.java:101)
at com.bumptech.glide.load.engine.EngineRunnable.run(EngineRunnable.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:118)

When the blur is finished, the input, output, and blur are all destroyed, along with the renderscript instance.

This resolves a strictmode 'resource acquired but never released' violation.
@timusus
Copy link
Contributor Author

timusus commented Nov 4, 2016

Any word on this one?

@RosesJack
Copy link

Could you destroy the ScriptIntrinsic ?

@timusus
Copy link
Contributor Author

timusus commented Mar 17, 2017

@wasabeef can you please have a look at the outstanding PR's?

@wasabeef
Copy link
Owner

@timusus

Sorry, I will check this weekend.

@wasabeef wasabeef merged commit 45c2e3b into wasabeef:master Mar 17, 2017
@wasabeef
Copy link
Owner

@timusus

I just released v2.0.2.

@timusus
Copy link
Contributor Author

timusus commented Mar 18, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants