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

Commit 8dc9afa9 authored by rago's avatar rago
Browse files

Fix scope for visualizer object release

Bug: 30684284
Change-Id: I4170511c6c7f36aa1bce3e439054bc6b8a4a2623
parent fca6ec8e
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -435,11 +435,12 @@ setup_failure:

// ----------------------------------------------------------------------------
static void android_media_visualizer_native_release(JNIEnv *env,  jobject thiz) {
    { //limit scope so that lpVisualizer is deleted before JNI storage data.
        sp<Visualizer> lpVisualizer = setVisualizer(env, thiz, 0);
        if (lpVisualizer == 0) {
            return;
        }

    }
    // delete the JNI data
    VisualizerJniStorage* lpJniStorage =
        (VisualizerJniStorage *)env->GetLongField(thiz, fields.fidJniData);