diff options
-rw-r--r-- | slicer/slicer/modelPartsTypes.h | 4 | ||||
-rw-r--r-- | slicer/slicer/modelPartsTypes.impl.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/slicer/slicer/modelPartsTypes.h b/slicer/slicer/modelPartsTypes.h index 71736bf..cbd953e 100644 --- a/slicer/slicer/modelPartsTypes.h +++ b/slicer/slicer/modelPartsTypes.h @@ -191,8 +191,8 @@ namespace Slicer { static const std::string * typeName; static ModelPartPtr CreateModelPart(void *); - static void initClassName() __attribute__ ((constructor(209))); - static void deleteClassName() __attribute__ ((destructor(209))); + static void initClassName(); + static void deleteClassName(); static void registerClass() __attribute__ ((constructor(210))); static void unregisterClass() __attribute__ ((destructor(210))); }; diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h index f9d8a4f..08c14b2 100644 --- a/slicer/slicer/modelPartsTypes.impl.h +++ b/slicer/slicer/modelPartsTypes.impl.h @@ -288,6 +288,7 @@ namespace Slicer { template<typename T> void ModelPartForClass<T>::registerClass() { + initClassName(); ModelPartForComplexBase::registerClass(*className, typeName, &ModelPartForClass<T>::CreateModelPart); } @@ -295,6 +296,7 @@ namespace Slicer { void ModelPartForClass<T>::unregisterClass() { ModelPartForComplexBase::unregisterClass(*className, typeName); + deleteClassName(); } template<typename T> |