From 805dc19d4a81e3d53ba86201a4ac4f69e4bad46d Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Wed, 2 Sep 2015 15:43:20 -1000 Subject: [PATCH] Initialization-order clarification --- hecl/blender/BlenderConnection.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hecl/blender/BlenderConnection.hpp b/hecl/blender/BlenderConnection.hpp index 7ba80abf0..86e2d3f16 100644 --- a/hecl/blender/BlenderConnection.hpp +++ b/hecl/blender/BlenderConnection.hpp @@ -95,10 +95,10 @@ public: } } m_sbuf; PyOutStream(BlenderConnection* parent, bool deleteOnError) - : m_parent(parent), - m_sbuf(*this, deleteOnError), + : std::ostream(&m_sbuf), + m_parent(parent), m_deleteOnError(deleteOnError), - std::ostream(&m_sbuf) + m_sbuf(*this, deleteOnError) { m_parent->m_lock = true; m_parent->_writeLine("PYBEGIN"); @@ -110,8 +110,7 @@ public: public: PyOutStream(const PyOutStream& other) = delete; PyOutStream(PyOutStream&& other) - : m_parent(other.m_parent), m_sbuf(std::move(other.m_sbuf)), - std::ostream(&m_sbuf) + : std::ostream(&m_sbuf), m_parent(other.m_parent), m_sbuf(std::move(other.m_sbuf)) {other.m_parent = nullptr;} ~PyOutStream() {close();} void close()