Fix a wp<> bug where the owner ID would be wrong
this was introduced recently. we make sure to use
the correct owner id (the sp) instead of the wp.
Change-Id: I78fdc6ec0c2d3e687278b70442d74d1924b512a2
diff --git a/include/utils/StrongPointer.h b/include/utils/StrongPointer.h
index 5daccf4..a8c9897 100644
--- a/include/utils/StrongPointer.h
+++ b/include/utils/StrongPointer.h
@@ -104,11 +104,8 @@
private:
template<typename Y> friend class sp;
template<typename Y> friend class wp;
-
- // Optimization for wp::promote().
- sp(T* p, bool);
-
- T* m_ptr;
+ void set_pointer(T* ptr);
+ T* m_ptr;
};
#undef COMPARE
@@ -206,10 +203,9 @@
}
template<typename T>
-sp<T>::sp(T* p, bool)
-: m_ptr(p)
- {
- }
+void sp<T>::set_pointer(T* ptr) {
+ m_ptr = ptr;
+}
template <typename T>
inline TextOutput& operator<<(TextOutput& to, const sp<T>& val)