Skip to content

Commit

Permalink
Fixing failures with MaterialX tests
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
klucknav authored and pixar-oss committed Dec 23, 2020
1 parent b81b387 commit 2ef22c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pxr/imaging/hdSt/materialXFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down

0 comments on commit 2ef22c8

Please sign in to comment.