From cd3fade2aaf74d1c3db345c13bd0122dc45d372f Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 15 Mar 2021 16:11:12 +0100 Subject: Fix Cycles rendering crash on OpenBSD Static initialization order was not guaranteed to be correct for node base types. Now wrap all initialization in accessor functions to ensure the order is correct. Did not cause any known bug on Linux/macOS/Windows, but showed up on this platform. --- intern/cycles/render/alembic.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'intern/cycles/render/alembic.cpp') diff --git a/intern/cycles/render/alembic.cpp b/intern/cycles/render/alembic.cpp index 0841a3c09cd..e4f0690c401 100644 --- a/intern/cycles/render/alembic.cpp +++ b/intern/cycles/render/alembic.cpp @@ -599,7 +599,7 @@ NODE_DEFINE(AlembicObject) NodeType *type = NodeType::add("alembic_object", create); SOCKET_STRING(path, "Alembic Path", ustring()); - SOCKET_NODE_ARRAY(used_shaders, "Used Shaders", &Shader::node_type); + SOCKET_NODE_ARRAY(used_shaders, "Used Shaders", Shader::get_node_type()); SOCKET_INT(subd_max_level, "Max Subdivision Level", 1); SOCKET_FLOAT(subd_dicing_rate, "Subdivision Dicing Rate", 1.0f); @@ -609,7 +609,7 @@ NODE_DEFINE(AlembicObject) return type; } -AlembicObject::AlembicObject() : Node(node_type) +AlembicObject::AlembicObject() : Node(get_node_type()) { schema_type = INVALID; } @@ -1320,12 +1320,12 @@ NODE_DEFINE(AlembicProcedural) SOCKET_FLOAT(default_radius, "Default Radius", 0.01f); SOCKET_FLOAT(scale, "Scale", 1.0f); - SOCKET_NODE_ARRAY(objects, "Objects", &AlembicObject::node_type); + SOCKET_NODE_ARRAY(objects, "Objects", AlembicObject::get_node_type()); return type; } -AlembicProcedural::AlembicProcedural() : Procedural(node_type) +AlembicProcedural::AlembicProcedural() : Procedural(get_node_type()) { objects_loaded = false; scene_ = nullptr; -- cgit v1.2.3