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

Commit e0496a2a authored by Steven Moreland's avatar Steven Moreland
Browse files

Use SharedRefBase::make to allocate.

SharedRefBase now encapsulates heap allocation in order to guard against
some types of double-ownership.

Bug: 149249948
Test: TH
Change-Id: Ida943c895225331a853e4c8da54454d60b17000a
parent 7e101988
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -713,7 +713,8 @@ status_t DrmHal::openSession(DrmPlugin::SecurityLevel level,
    } while (retry);

    if (err == OK) {
        std::shared_ptr<DrmSessionClient> client(new DrmSessionClient(this, sessionId));
        std::shared_ptr<DrmSessionClient> client =
                ndk::SharedRefBase::make<DrmSessionClient>(this, sessionId);
        DrmSessionManager::Instance()->addSession(AIBinder_getCallingPid(),
                std::static_pointer_cast<IResourceManagerClient>(client), sessionId);
        mOpenSessions.push_back(client);