diff options
| author | 2020-03-12 01:23:50 +0000 | |
|---|---|---|
| committer | 2020-03-12 01:23:50 +0000 | |
| commit | 42ee916c1f5d2c38a400e32908d7a6e11a92a8f4 (patch) | |
| tree | 732a2e152de64efda0b8067001dfb92fc4b32a41 | |
| parent | 592181386c651aa12975db5b38d7550d050b8dd2 (diff) | |
| parent | 9bebf81345a5e9dd717d2c1027d3f4354d22d9ef (diff) | |
Merge "SoundPool: Set completion flag before promise" into rvc-dev
| -rw-r--r-- | media/jni/soundpool/StreamManager.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/media/jni/soundpool/StreamManager.h b/media/jni/soundpool/StreamManager.h index 15b39f2df891..30ad220db05b 100644 --- a/media/jni/soundpool/StreamManager.h +++ b/media/jni/soundpool/StreamManager.h @@ -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; } |