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

Commit d2f81ce2 authored by Fan Xu's avatar Fan Xu
Browse files

Use sp<> on creating BufferHubBinderService

The original code implicitly calls the constructor of sp<> in
addService() function call, which is not good for readability. Replace
it with sp<> could improve readability and avoid possible memory leak if
the implementation detail of sp<> changes.

Test: atest buffer_hub_binder_service-test (passed)
Bug: 115429751
Change-Id: Ice304a638b8d353a3b229e48c17ecd6f32a66f37
parent 7e86280f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ status_t BufferHubBinderService::start(
    const std::shared_ptr<BufferHubService>& pdx_service) {
  IPCThreadState::self()->disableBackgroundScheduling(true);

  BufferHubBinderService* service = new BufferHubBinderService();
  sp<BufferHubBinderService> service = new BufferHubBinderService();
  service->pdx_service_ = pdx_service;

  // Not using BinderService::publish because need to get an instance of this