Skip to content

Commit 39b4ab3

Browse files
committed
BUG: Internal factory must use RegisterFactoryInternal method
If just RegisterFactory is called to register an internal factory, this will cause the dynamic libraries to be loaded during static initialization. This is undesired behavior and may cause a race condition of shared libraries loading other shared libraries. Additionally, applications have been setting ITK_AUTOLOAD path during executing, before any object were created or other objects registered. This patch restores the behavior of the dynamic libraries being loaded with this usage. Change-Id: I88433ba6e0bcc1885c5e11a54307d0e6c481f85e
1 parent fb306df commit 39b4ab3

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

Modules/IO/TransformHDF5/include/itkHDF5TransformIOFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class HDF5TransformIOFactory:public ObjectFactoryBase
5454
{
5555
HDF5TransformIOFactory::Pointer metaFactory = HDF5TransformIOFactory::New();
5656

57-
ObjectFactoryBase::RegisterFactory(metaFactory);
57+
ObjectFactoryBase::RegisterFactoryInternal(metaFactory);
5858
}
5959

6060
protected:

Modules/IO/TransformInsightLegacy/include/itkTxtTransformIOFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class ITK_EXPORT TxtTransformIOFactory:public ObjectFactoryBase
5353
{
5454
TxtTransformIOFactory::Pointer metaFactory = TxtTransformIOFactory::New();
5555

56-
ObjectFactoryBase::RegisterFactory(metaFactory);
56+
ObjectFactoryBase::RegisterFactoryInternal(metaFactory);
5757
}
5858

5959
protected:

Modules/IO/TransformMatlab/include/itkMatlabTransformIOFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ITK_EXPORT MatlabTransformIOFactory:public ObjectFactoryBase
5555
MatlabTransformIOFactory::Pointer metaFactory =
5656
MatlabTransformIOFactory::New();
5757

58-
ObjectFactoryBase::RegisterFactory(metaFactory);
58+
ObjectFactoryBase::RegisterFactoryInternal(metaFactory);
5959
}
6060

6161
protected:

Modules/Nonunit/Review/include/itkMRCImageIOFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ITK_EXPORT MRCImageIOFactory:public ObjectFactoryBase
6969
{
7070
MRCImageIOFactory::Pointer vtkFactory = MRCImageIOFactory::New();
7171

72-
ObjectFactoryBase::RegisterFactory(vtkFactory);
72+
ObjectFactoryBase::RegisterFactoryInternal(vtkFactory);
7373
}
7474

7575
protected:

0 commit comments

Comments
 (0)