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

Commit 3297a174 authored by Zhanglong Xia's avatar Zhanglong Xia
Browse files

remove manually freeing the variable mDeathRecipient

The variable `mDeathRecipient` will automatically free the allocated
memory when it is destructed. This CL deletes the code for manually
releasing the variable `mDeathRecipient` to avoid the same variable
being freed twice.

Bug: 296617022
Test: Run fuzzer test.
Change-Id: I733f7f8d26e48a9434d41c5098f39ad91208abeb
parent 7f2619dd
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -59,10 +59,6 @@ ThreadChip::ThreadChip(char* url) : mUrl(), mRxFrameBuffer(), mCallback(nullptr)
    AIBinder_DeathRecipient_setOnUnlinked(mDeathRecipient.get(), ThreadChip::onBinderUnlinkedJump);
}

ThreadChip::~ThreadChip() {
    AIBinder_DeathRecipient_delete(mDeathRecipient.get());
}

void ThreadChip::onBinderDiedJump(void* context) {
    reinterpret_cast<ThreadChip*>(context)->onBinderDied();
}
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ namespace threadnetwork {
class ThreadChip : public BnThreadChip, ot::Posix::Mainloop::Source {
  public:
    ThreadChip(char* url);
    ~ThreadChip();
    ~ThreadChip() {}

    ndk::ScopedAStatus open(const std::shared_ptr<IThreadChipCallback>& in_callback) override;
    ndk::ScopedAStatus close() override;