summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/memory/weak_ptr.h
diff options
context:
space:
mode:
authorYDBot <[email protected]>2025-09-26 05:40:56 +0000
committerYDBot <[email protected]>2025-09-26 05:40:56 +0000
commita7e5af7043672a57f330696519f435f19fcd03d0 (patch)
treefa751accfbb8afcd928340c9078b00453c07dde1 /library/cpp/yt/memory/weak_ptr.h
parentd7cd65635ff05f602b8eb7c6e2a42217057dd2c6 (diff)
parentee5ee24a4d661a146d6142a78050207193937281 (diff)
Merge pull request #25828 from ydb-platform/merge-rightlib-250926-0050
Diffstat (limited to 'library/cpp/yt/memory/weak_ptr.h')
-rw-r--r--library/cpp/yt/memory/weak_ptr.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/library/cpp/yt/memory/weak_ptr.h b/library/cpp/yt/memory/weak_ptr.h
index e7b847653d4..5298954e563 100644
--- a/library/cpp/yt/memory/weak_ptr.h
+++ b/library/cpp/yt/memory/weak_ptr.h
@@ -55,8 +55,13 @@ public:
//! Copy constructor.
TWeakPtr(const TWeakPtr& other) noexcept
- : TWeakPtr(other.T_)
- { }
+ : T_(other.T_)
+#if defined(_tsan_enabled_)
+ , RefCounter_(other.RefCounter_)
+#endif
+ {
+ AcquireRef();
+ }
//! Copy constructor with an upcast.
template <class U, class = typename std::enable_if_t<std::is_convertible_v<U*, T*>>>