prof18 / RSS-Parser

A Kotlin Multiplatform library to parse a RSS Feed
Apache License 2.0
490 stars 126 forks source link

Resource leak #107

Closed ashishb closed 1 year ago

ashishb commented 1 year ago

Describe the bug

Resource leak in CoreXMLFetcher.kt:17

StrictMode policy violation: android.os.strictmode.LeakedClosableViolation:
   A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
   D      at android.os.StrictMode$AndroidCloseGuardReporter.report(StrictMode.java:1987)
   D      at dalvik.system.CloseGuard.warnIfOpen(CloseGuard.java:336)
   D      at java.util.zip.Inflater.finalize(Inflater.java:407)
   D      at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:319)
   D      at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:306)
   D      at java.lang.Daemons$Daemon.run(Daemons.java:140)
   D      at java.lang.Thread.run(Thread.java:1012)
   D  Caused by: java.lang.Throwable: Explicit termination method 'end' not called
   D      at dalvik.system.CloseGuard.openWithCallSite(CloseGuard.java:288)
   D      at dalvik.system.CloseGuard.open(CloseGuard.java:257)
   D      at java.util.zip.Inflater.<init>(Inflater.java:122)
   D      at okio.GzipSource.<init>(GzipSource.kt:44)
   D      at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:95)
   D      at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
   D      at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
   D      at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
   D      at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
   D      at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
   D      at com.google.firebase.perf.network.FirebasePerfOkHttpClient.execute(FirebasePerfOkHttpClient.java:44)
   D      at com.prof.rssparser.core.CoreXMLFetcher.fetchXML(CoreXMLFetcher.kt:17)
   D      at com.prof.rssparser.engineforjava.XMLFetcher.call(XMLFetcher.kt:32)
   D      at com.prof.rssparser.engineforjava.XMLFetcher.call(XMLFetcher.kt:25)
   D      at java.util.concurrent.FutureTask.run(FutureTask.java:264)
   D      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
   D      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
prof18 commented 1 year ago

Ops, thanks for reporting that! A fix will be in the next release