1. Download our Official Android App: Forums for Android!

Apps clean up jboolean c++

Discussion in 'Android Development' started by chyra, Aug 22, 2012.

  1. chyra

    chyra Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Aug 22, 2012

    Aug 22, 2012
    1
    0
    5
    I'm working on an android app and I have problem with memory leakage.
    I have found the problem but my c++ knowledge is very limited so I do not know how to solve the problem.

    I have a c++ jni and I don't know how to clean up after my self, delete the visible_texture variable. Can someone help me with the code that would solve this problem. Thanks in advance!

    Code (Text):
    1. JNIEXPORT void JNICALL //int chAnimation added, will choose animation
    2. Java_com_qualcomm_QCARSamples_ImageTargets_ImageTargetsRenderer_renderFrame(JNIEnv *env, jobject, jbooleanArray jarray)
    3. {
    4.     jboolean isCopy1;
    5.     jboolean* visible_texture = env -> GetBooleanArrayElements(jarray, isCopy1);
     

    Advertisement

  2. jonbonazza

    jonbonazza Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    1,930
    Joined:
    Jul 13, 2010

    Jul 13, 2010
    1,930
    457
    163
    Male
    to clean up, you would do something like:
    Code (Text):
    1.  
    2. delete[] visible_textures;
    3. visible_textures = 0;
    4.  
     

Share This Page

Loading...