0031075: Application Framework - reading STEP file into TDocStd_Document leads to...
[occt.git] / src / TPrsStd / TPrsStd_DriverTable.cxx
index c209673..857ccc9 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <TPrsStd_DriverTable.ixx>
 
-#include <TPrsStd_DataMapOfGUIDDriver.hxx>
-
-#include <TPrsStd_Driver.hxx>
+#include <Standard_GUID.hxx>
+#include <Standard_Type.hxx>
+#include <TDataXtd_Axis.hxx>
+#include <TDataXtd_Constraint.hxx>
+#include <TDataXtd_Geometry.hxx>
+#include <TDataXtd_Plane.hxx>
+#include <TDataXtd_Point.hxx>
+#include <TNaming_NamedShape.hxx>
 #include <TPrsStd_AxisDriver.hxx>
 #include <TPrsStd_ConstraintDriver.hxx>
+#include <TPrsStd_DataMapOfGUIDDriver.hxx>
+#include <TPrsStd_Driver.hxx>
+#include <TPrsStd_DriverTable.hxx>
 #include <TPrsStd_GeometryDriver.hxx>
 #include <TPrsStd_NamedShapeDriver.hxx>
 #include <TPrsStd_PlaneDriver.hxx>
 #include <TPrsStd_PointDriver.hxx>
 
-#include <TDataXtd_Axis.hxx>
-#include <TDataXtd_Constraint.hxx>
-#include <TDataXtd_Geometry.hxx>
-#include <TNaming_NamedShape.hxx>
-#include <TDataXtd_Plane.hxx>
-#include <TDataXtd_Point.hxx>
-
+IMPLEMENT_STANDARD_RTTIEXT(TPrsStd_DriverTable,Standard_Transient)
 
 static Handle(TPrsStd_DriverTable) drivertable;
 
@@ -46,8 +47,10 @@ Handle(TPrsStd_DriverTable) TPrsStd_DriverTable::Get()
   if ( drivertable.IsNull() )
   {
     drivertable = new TPrsStd_DriverTable;
+    // it must be never destroyed, even this library is unloaded
+    new Handle(TPrsStd_DriverTable)(drivertable);
 #ifdef OCCT_DEBUG
-    cout << "The new TPrsStd_DriverTable was created" << endl;
+    std::cout << "The new TPrsStd_DriverTable was created" << std::endl;
 #endif
   }
   return drivertable;