Replace lazy_ptr's Init() with reset() method

The function Init() called by one of the constructors of lazy_ptr is undefined.
Replacing with reset method sets the object to an uninitialized state and assigns a new constructor function

Fix submitted on github by zhoumin2 - https://github.com/ROCm/ROCR-Runtime/pull/184

Change-Id: I7d906d526ce7fe7e2548b01810e6395b13497bf3


[ROCm/ROCR-Runtime commit: 00b63f7452]
This commit is contained in:
Shweta.Khatri
2024-03-22 23:55:42 -04:00
committad av Shweta Khatri
förälder cef0e09844
incheckning 565dbac2d4
@@ -59,7 +59,7 @@ template <typename T> class lazy_ptr {
public:
lazy_ptr() {}
explicit lazy_ptr(std::function<T*()> Constructor) { Init(Constructor); }
explicit lazy_ptr(std::function<T*()> Constructor) { reset(Constructor); }
lazy_ptr(lazy_ptr&& rhs) {
obj = std::move(rhs.obj);