src/core/android/SDL_android.c
changeset 11665 861f42ecf09a
parent 11662 a996f135cc81
child 11669 1fe21a20aa12
     1.1 --- a/src/core/android/SDL_android.c	Wed Nov 01 10:07:04 2017 -0700
     1.2 +++ b/src/core/android/SDL_android.c	Wed Nov 01 17:30:02 2017 -0700
     1.3 @@ -1065,9 +1065,19 @@
     1.4      float nativeYdpi = (*env)->GetFloatField(env, jDisplayObj, fidYdpi);
     1.5      int nativeDdpi = (*env)->GetIntField(env, jDisplayObj, fidDdpi);
     1.6  
     1.7 -    *ddpi = (float)nativeDdpi;
     1.8 -    *xdpi = nativeXdpi;
     1.9 -    *ydpi = nativeYdpi;
    1.10 +
    1.11 +    (*env)->DeleteLocalRef(env, jDisplayObj);
    1.12 +    (*env)->DeleteLocalRef(env, jDisplayClass);
    1.13 +
    1.14 +    if (ddpi) {
    1.15 +        *ddpi = (float)nativeDdpi;
    1.16 +    }
    1.17 +    if (xdpi) {
    1.18 +        *xdpi = nativeXdpi;
    1.19 +    }
    1.20 +    if (ydpi) {
    1.21 +        *ydpi = nativeYdpi;
    1.22 +    }
    1.23  
    1.24      return 0;
    1.25  }