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

Commit 53d3550a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "WebmFrameThread: clear mThread after join."

parents 107488f4 606e71cf
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -37,17 +37,23 @@ void *WebmFrameThread::wrap(void *arg) {
}

status_t WebmFrameThread::start() {
    status_t err = OK;
    pthread_attr_t attr;
    pthread_attr_init(&attr);
    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
    pthread_create(&mThread, &attr, WebmFrameThread::wrap, this);
    if ((err = pthread_create(&mThread, &attr, WebmFrameThread::wrap, this))) {
        mThread = 0;
    }
    pthread_attr_destroy(&attr);
    return OK;
    return err;
}

status_t WebmFrameThread::stop() {
    void *status;
    void *status = nullptr;
    if (mThread) {
        pthread_join(mThread, &status);
        mThread = 0;
    }
    return (status_t)(intptr_t)status;
}