From 2ef22c8211891beaae43487fb670b1cf42c9db6a Mon Sep 17 00:00:00 2001 From: klucknav Date: Wed, 23 Dec 2020 14:41:05 -0800 Subject: [PATCH] Fixing failures with MaterialX tests Was returning a reference to a string through a temporary variable, so the memory was being freed before the string was actally being stored down the line. (Internal change: 2131416) --- pxr/imaging/hdSt/materialXFilter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pxr/imaging/hdSt/materialXFilter.cpp b/pxr/imaging/hdSt/materialXFilter.cpp index 1a2a8b3bf7..63de97d69c 100644 --- a/pxr/imaging/hdSt/materialXFilter.cpp +++ b/pxr/imaging/hdSt/materialXFilter.cpp @@ -66,7 +66,7 @@ TF_DEFINE_PRIVATE_TOKENS( // Generate the Glsl Pixel Shader based on the given mxContext and mxElement // Based on MaterialXViewer Material::generateShader() -static const std::string & +static std::string _GenPixelShader(mx::GenContext & mxContext, mx::TypedElementPtr const& mxElem) { @@ -87,7 +87,7 @@ _GenPixelShader(mx::GenContext & mxContext, // Use the given mxDocument to generate the corresponding glsl source code // Based on MaterialXViewer Viewer::loadDocument() -static const std::string & +static std::string _GenSourceCode(mx::DocumentPtr const& mxDoc, mx::FileSearchPath const& searchPath) {