From 7b4ef80c40aa4d760d136ecab87b26835a5686cf Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 8 Mar 2014 18:53:42 +0400 Subject: [PATCH] Lazy constructor init fix --- libuavcan/include/uavcan/internal/lazy_constructor.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libuavcan/include/uavcan/internal/lazy_constructor.hpp b/libuavcan/include/uavcan/internal/lazy_constructor.hpp index d20b37a072..03bd2963ce 100644 --- a/libuavcan/include/uavcan/internal/lazy_constructor.hpp +++ b/libuavcan/include/uavcan/internal/lazy_constructor.hpp @@ -42,11 +42,14 @@ class LazyConstructor public: LazyConstructor() : ptr_(NULL) - { } + { + std::fill(data_, data_ + sizeof(T), 0); + } LazyConstructor(const LazyConstructor& rhs) : ptr_(NULL) { + std::fill(data_, data_ + sizeof(T), 0); if (rhs) construct(*rhs); // Invoke copy constructor }