Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26f8ce83 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru Committed by android code review
Browse files

Merge "To avoid the JNI memory leaks in video editor codes"

parents f515c6f4 c96a7294
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1853,6 +1853,9 @@ videoEditClasses_getEditSettings(
                            // Get the clip settings.
                            videoEditClasses_getClipSettings(pResult, pEnv, clipSettings,
                                &pSettings->pClipList[i]);

                            // Free the local references to avoid memory leaks
                            pEnv->DeleteLocalRef(clipSettings);
                        }
                    }
                }
@@ -1877,6 +1880,9 @@ videoEditClasses_getEditSettings(
                            // Get the transition settings.
                            videoEditClasses_getTransitionSettings(pResult, pEnv,
                                    transitionSettings, &pSettings->pTransitionList[i]);

                            // Free the local references to avoid memory leaks
                            pEnv->DeleteLocalRef(transitionSettings);
                        }
                    }
                }
@@ -1900,6 +1906,9 @@ videoEditClasses_getEditSettings(
                            // Get the effect settings.
                            videoEditClasses_getEffectSettings(pResult, pEnv, effectSettings,
                                    &pSettings->Effects[i]);

                            // Free the local references to avoid memory leaks
                            pEnv->DeleteLocalRef(effectSettings);
                        }
                    }
                }
+3 −0
Original line number Diff line number Diff line
@@ -387,6 +387,9 @@ videoEditJava_getString(
                (*pLength) = length;
            }
        }

        // Delete local references to avoid memory leaks
        pEnv->DeleteLocalRef(string);
    }

    // Return the string.
+5 −0
Original line number Diff line number Diff line
@@ -380,6 +380,9 @@ getClipSetting(
                    pEnv->GetIntField(object,fid);
   M4OSA_TRACE1_1("videoRotation = %d",
                    pSettings->ClipProperties.videoRotationDegrees);

   // Free the local references to avoid memory leaks
   pEnv->DeleteLocalRef(clazz);
}

static void jniPreviewProgressCallback (void* cookie, M4OSA_UInt32 msgType,
@@ -1849,7 +1852,9 @@ videoEditor_populateSettings(
                "not initialized");
            if (needToBeLoaded) {
                getClipSetting(pEnv,properties, pContext->pEditSettings->pClipList[i]);
                pEnv->DeleteLocalRef(properties);
            } else {
                pEnv->DeleteLocalRef(properties);
                goto videoEditor_populateSettings_cleanup;
            }
        }