================
@@ -754,6 +760,7 @@ class Debugger : public 
std::enable_shared_from_this<Debugger>,
   uint32_t m_interrupt_requested = 0; ///< Tracks interrupt requests
   std::mutex m_interrupt_mutex;
 
+  std::shared_ptr<LldbTelemeter> m_telemeter;
----------------
labath wrote:

Yes, please. If the pointer is non-null (I don't remember if you create a dummy 
object when telemetry is disabled, or if you keep this null), then also make 
this a reference.

shared_ptr is for sharing the *ownership* of an object. There's nothing wrong 
with handing out a non-owning reference/pointer to other code (if we can ensure 
that object is not destroyed in the mean time, which usually means that the 
other code should not persist that pointer anywhere).

https://github.com/llvm/llvm-project/pull/98528
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to