Skip to content

Commit b34409d

Browse files
nyoungbqJDuffeyBQ
andauthored
BUG: Use a Static Boolean to Register ITK Factories Once (#1451)
* Use a static bool to Register ITK factories once * Update src/Plugins/ITKImageProcessing/src/ITKImageProcessing/ITKImageProcessingPlugin.cpp Co-authored-by: Jared Duffey <[email protected]> * Update ITKImageProcessingPlugin.hpp --------- Co-authored-by: Jared Duffey <[email protected]>
1 parent 4e5fac6 commit b34409d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Plugins/ITKImageProcessing/src/ITKImageProcessing/ITKImageProcessingPlugin.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ ITKImageProcessingPlugin::ITKImageProcessingPlugin()
3434
{
3535
addFilter(filterFunc);
3636
}
37-
RegisterITKImageIO();
37+
38+
static bool s_IsRegistered = false;
39+
if(!s_IsRegistered)
40+
{
41+
RegisterITKImageIO();
42+
s_IsRegistered = true;
43+
}
3844
}
3945

4046
ITKImageProcessingPlugin::~ITKImageProcessingPlugin() noexcept = default;

0 commit comments

Comments
 (0)