mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 06:03:35 +08:00
Lazy constructor init fix
This commit is contained in:
@@ -42,11 +42,14 @@ class LazyConstructor
|
|||||||
public:
|
public:
|
||||||
LazyConstructor()
|
LazyConstructor()
|
||||||
: ptr_(NULL)
|
: ptr_(NULL)
|
||||||
{ }
|
{
|
||||||
|
std::fill(data_, data_ + sizeof(T), 0);
|
||||||
|
}
|
||||||
|
|
||||||
LazyConstructor(const LazyConstructor<T>& rhs)
|
LazyConstructor(const LazyConstructor<T>& rhs)
|
||||||
: ptr_(NULL)
|
: ptr_(NULL)
|
||||||
{
|
{
|
||||||
|
std::fill(data_, data_ + sizeof(T), 0);
|
||||||
if (rhs)
|
if (rhs)
|
||||||
construct(*rhs); // Invoke copy constructor
|
construct(*rhs); // Invoke copy constructor
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user