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

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

Merge "Release the mutex before calling hidl_cb" into oc-dr1-dev

parents 98d6d922 383f61d9
Loading
Loading
Loading
Loading
+38 −35
Original line number Diff line number Diff line
@@ -90,13 +90,15 @@ Return<void> Omx::allocateNode(
    using ::android::IOMXNode;
    using ::android::IOMXObserver;

    sp<OMXNodeInstance> instance;
    {
        Mutex::Autolock autoLock(mLock);
        if (mLiveNodes.size() == kMaxNodeInstances) {
            _hidl_cb(toStatus(NO_MEMORY), nullptr);
            return Void();
        }

    sp<OMXNodeInstance> instance = new OMXNodeInstance(
        instance = new OMXNodeInstance(
                this, new LWOmxObserver(observer), name.c_str());

        OMX_COMPONENTTYPE *handle;
@@ -128,8 +130,9 @@ Return<void> Omx::allocateNode(
        }

        mLiveNodes.add(observer.get(), instance);
    observer->linkToDeath(this, 0);
        mNode2Observer.add(instance.get(), observer.get());
    }
    observer->linkToDeath(this, 0);

    _hidl_cb(toStatus(OK), new TWOmxNode(instance));
    return Void();