I suddenly got some crashes when using the URL class.
My code is trying to download an image like this
This has worked fine in the past, but I update the Juce code to the latest version, and I’m now getting crashes with this call.
I’m not sure what the root cause is, but I have tracked the issue down to the WebInputStream class and the connect function.
On about line 968 it calls:
if (! connection->start (owner, webInputListener))
Problem is that connection might be null (for reasons I don´t know), this will of course lead to an access violation.
inserting a check just before the “start” code seems to fix the issue.
I added this on line 967 of juce_mac_Network.mm and all seems good.
if (connection == nullptr ) return false;
I should add that I run my code in a separate thread, not the message thread, is this not OK?