Skip to content

Commit bad6b26

Browse files
committed
Protecting against invalid GU_Detail and scoping the lock.
1 parent 1026975 commit bad6b26

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/IECoreHoudini/GR_CortexPrimitive.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,15 @@ void GR_CortexPrimitive::update( RE_Render *r, const GT_PrimitiveHandle &primh,
132132

133133
#if UT_MAJOR_VERSION_INT >= 15
134134

135-
const GU_Detail *detail = p.geometry.castAwayConst().readLock();
135+
GU_DetailHandleAutoReadLock handle( p.geometry );
136+
if ( !handle.isValid() )
137+
{
138+
m_scene = 0;
139+
m_renderable = 0;
140+
return;
141+
}
142+
143+
const GU_Detail *detail = handle.getGdp();
136144

137145
#else
138146

0 commit comments

Comments
 (0)