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

Commit 10317edc authored by Simon Bowden's avatar Simon Bowden
Browse files

Add a comment on how to achieve shared_from_this for SharedRefBase.

It was time-consuming to figure out what was happening here as a newcomer. Linking to the bug where conversion was attempted for blame log convenience.

I also tweaked the main description to be a bit clearer.

Bug: 194905505
Change-Id: Ie5fc5a508c65c8a105a720cbef07ffdfdc6e7395
Test: comments-only
parent a70c45db
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -43,10 +43,12 @@
namespace ndk {
namespace ndk {


/**
/**
 * analog using std::shared_ptr for internally held refcount
 * Binder analog to using std::shared_ptr for an internally held refcount.
 *
 *
 * ref must be called at least one time during the lifetime of this object. The recommended way to
 * ref must be called at least one time during the lifetime of this object. The recommended way to
 * construct this object is with SharedRefBase::make.
 * construct this object is with SharedRefBase::make.
 *
 * If you need a "this" shared reference analogous to shared_from_this, use this->ref().
 */
 */
class SharedRefBase {
class SharedRefBase {
   public:
   public: