https://kotlinlang.org logo
#getting-started
Title
# getting-started
p

pavi2410

11/22/2021, 1:52 PM
I'm using
URL.readText()
extension function from stdlib but for some unknown reason, it's not
close
-ing the resources. However, the output is just printed fine at line 43
j

Joffrey

11/22/2021, 2:04 PM
URL.readText
internally calls:
Copy code
openStream().use { it.readBytes() }
the call to
use
here should automatically close the input stream, so I don't believe this should be causing any problems
Are you sure the stacktrace is pointing to this line?
p

pavi2410

11/22/2021, 2:06 PM
Yes, this is a new Compose project and it's the only line.
Something must be wrong in the libraries itself. It shows the same error message upon commenting out all my custom code.
But that combo of libraries work on my other app 😞
j

Joffrey

11/22/2021, 2:31 PM
Sorry to hear that, unfortunately I have 0 experience with compose projects, so I can't even compare locally
p

pavi2410

11/22/2021, 2:31 PM
No problem. Thanks anyways
Btw, do you know how can I detect open sockets or any other system resources?
6 Views