[Insight-developers] Static initialization in itkImageSource causes early registration of ITKIOFactory

Brad King brad.king at kitware.com
Thu Apr 4 08:59:28 EDT 2013


On 04/04/2013 08:48 AM, Bradley Lowekamp wrote:
> why this static "HasBeenRegistered" variable was used instead
> of a mechanism which gives each factory a unique ID, and
> ensuring it only get's registered in the factory one.

It was written assuming that global variables are really global
and exist only once in a process.  Windows plugins without fully
shared ITK libraries make that impossible but the use case was
not considered at the time.  We just had to get distributed I/O
factory registration working during modularization.  If you have
a better solution then go for it.

-Brad K


More information about the Insight-developers mailing list