src/core/android/SDL_android.cpp
changeset 6828 ac7f004fb63c
parent 6816 b3d3ef1e15b5
child 6864 97187387ad79
     1.1 --- a/src/core/android/SDL_android.cpp	Sun Jan 27 15:56:28 2013 -0800
     1.2 +++ b/src/core/android/SDL_android.cpp	Sun Jan 27 21:43:20 2013 -0300
     1.3 @@ -593,7 +593,6 @@
     1.4          goto fallback;
     1.5      }
     1.6  
     1.7 -    ctx->hidden.androidio.assetFileDescriptorRef = mEnv->NewGlobalRef(inputStream);
     1.8      mid = mEnv->GetMethodID(mEnv->GetObjectClass(inputStream), "getStartOffset", "()J");
     1.9      ctx->hidden.androidio.offset = mEnv->CallLongMethod(inputStream, mid);
    1.10      if (Android_JNI_ExceptionOccurred()) {
    1.11 @@ -602,7 +601,6 @@
    1.12  
    1.13      mid = mEnv->GetMethodID(mEnv->GetObjectClass(inputStream), "getDeclaredLength", "()J");
    1.14      ctx->hidden.androidio.size = mEnv->CallLongMethod(inputStream, mid);
    1.15 -    
    1.16      if (Android_JNI_ExceptionOccurred()) {
    1.17          goto fallback;
    1.18      }
    1.19 @@ -612,6 +610,7 @@
    1.20      fdCls = mEnv->GetObjectClass(fd);
    1.21      descriptor = mEnv->GetFieldID(fdCls, "descriptor", "I");
    1.22      ctx->hidden.androidio.fd = mEnv->GetIntField(fd, descriptor);
    1.23 +    ctx->hidden.androidio.assetFileDescriptorRef = mEnv->NewGlobalRef(inputStream);
    1.24  
    1.25      // Seek to the correct offset in the file.
    1.26      lseek(ctx->hidden.androidio.fd, (off_t)ctx->hidden.androidio.offset, SEEK_SET);