Browse Source

Added an assertion for android to catch use of HTTP on the main thread (not allowed by the OS)

tags/2021-05-28
jules 11 years ago
parent
commit
8d340d587e
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      modules/juce_core/native/juce_android_Network.cpp

+ 4
- 0
modules/juce_core/native/juce_android_Network.cpp View File

@@ -87,6 +87,10 @@ public:
LocalRef<jobject> responseHeaderBuffer (env->NewObject (StringBuffer, StringBuffer.constructor));
// Annoyingly, the android HTTP functions will choke on this call if you try to do it on the message
// thread. You'll need to move your networking code to a background thread to keep it happy..
jassert (Thread::getCurrentThread() != nullptr);
stream = GlobalRef (env->CallStaticObjectMethod (JuceAppActivity,
JuceAppActivity.createHTTPStream,
javaString (address).get(),


Loading…
Cancel
Save