1

平台/框架/基础/核心/jni/android/graphics/BitmapFactory.cpp:212 ...

 if (peeker.fPatchIsValid) {
     size_t ninePatchArraySize = peeker.fPatch->serializedSize();
     ninePatchChunk = env->NewByteArray(ninePatchArraySize);        **<= alloc here**
     if (NULL == ninePatchChunk) {
         return nullObjectReturn("ninePatchChunk == null");
     }
     jbyte* array = (jbyte*)env->GetPrimitiveArrayCritical(ninePatchChunk,
                                                           NULL);
     if (NULL == array) {
                                    **<= should we release ninePatchChunk here**
         return nullObjectReturn("primitive array == null");
     }
     peeker.fPatch->serialize(array);
     env->ReleasePrimitiveArrayCritical(ninePatchChunk, array, 0);
 }

GC 将 realese 这个对象或者我们应该这样做?

4

1 回答 1

0

因此,如果发生错误,这是否是泄漏?

于 2012-07-09T09:31:57.347 回答