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

Commit 9bebf813 authored by Andy Hung's avatar Andy Hung
Browse files

SoundPool: Set completion flag before promise

Restores order of setting and promise changed by
commit eaeced33

Test: android.media.cts.SoundPool(Aac|Haptic|Midi|Ogg)Test
Bug: 151161792
Change-Id: I0e9cc173dbcc6080bfbbd15e1cab059812f54c97
parent cfdd34ad
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -70,9 +70,10 @@ private:
    static int staticFunction(void *data) {
        JavaThread *jt = static_cast<JavaThread *>(data);
        jt->mF();
        jt->mIsClosed = true;  // set the flag that we are closed
                               // now before we allow the destructor to execute;
                               // otherwise there may be a use after free.
        jt->mPromise.set_value();
        jt->mIsClosed = true;  // publicly inform that we are closed
                               // after we have accessed all variables.
        return 0;
    }