Skip to content

Commit

Permalink
Merge pull request #5956 from johnhaddon/formatPlugFix
Browse files Browse the repository at this point in the history
FormatPlug binding : Fix GIL management bug
  • Loading branch information
ericmehl authored Jul 11, 2024
2 parents a84fc54 + ab0415b commit 6df201e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Fixes
- LightEditor : Fixed regression (introduced in 1.4.8.0) causing the mute and solo icons to not show up for groups.
- Windows : Fixed conflicts with other software installations on `PATH`. The `PXR_USD_WINDOWS_DLL_PATH` environment variable is now set to an empty string if it is not already set, preventing USD from adding all entries from `PATH` to Python's DLL search paths.
- AnnotationsGadget : Fixed potential hang in `annotationText()` Python binding.
- FormatPlug : Fixed potential hang in `acquireDefaultFormatPlug()` Python binding.

API
---
Expand Down
8 changes: 7 additions & 1 deletion src/GafferImageModule/CoreBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ Format getValue( const FormatPlug *plug )
return plug->getValue();
}

FormatPlugPtr acquireDefaultFormatPlugWrapper( Gaffer::ScriptNode &scriptNode )
{
IECorePython::ScopedGILRelease gilRelease;
return FormatPlug::acquireDefaultFormatPlug( &scriptNode );
}

class FormatPlugSerialiser : public GafferBindings::ValuePlugSerialiser
{

Expand Down Expand Up @@ -431,7 +437,7 @@ void GafferImageModule::bindCore()
.staticmethod( "setDefaultFormat" )
.def( "getDefaultFormat", &FormatPlug::getDefaultFormat )
.staticmethod( "getDefaultFormat" )
.def( "acquireDefaultFormatPlug", &FormatPlug::acquireDefaultFormatPlug, return_value_policy<IECorePython::CastToIntrusivePtr>() )
.def( "acquireDefaultFormatPlug", &acquireDefaultFormatPlugWrapper )
.staticmethod( "acquireDefaultFormatPlug" )
;

Expand Down

0 comments on commit 6df201e

Please sign in to comment.