Salome HOME
Fix for bug Bug IPAL20288 (4x: CRASH after trying to build a sketch).
[modules/geom.git] / src / GEOMImpl / GEOMImpl_ExportDriver.cxx
index 77d6acc32b11f2156541ce605e3a5fc9acd79269..5ea854b9625c36a20e9e0cc0a05bad542fe2f88f 100644 (file)
@@ -28,7 +28,7 @@
 #include <TopoDS_Shape.hxx>
 #include <TCollection_AsciiString.hxx>
 
-#include <Standard_ConstructionError.hxx>
+#include <Standard_Failure.hxx>
 
 #ifdef WNT
 #include <windows.h>
@@ -99,19 +99,25 @@ Standard_Integer GEOMImpl_ExportDriver::Execute(TFunction_Logbook& log) const
     return 0;
 
   // load plugin library
-  LibHandle anExportLib = LoadLib( aLibName.ToCString() );
+  LibHandle anExportLib = LoadLib( aLibName.ToCString() ); //This is workaround of BUG OCC13051
   funcPoint fp = 0;
   if ( anExportLib )
     fp = (funcPoint)GetProc( anExportLib, "Export" );
 
-  if ( !fp )
-    return 0;
+  if ( !fp ) {
+    TCollection_AsciiString aMsg = aFormatName;
+    aMsg += " plugin was not installed";
+    Standard_Failure::Raise(aMsg.ToCString());
+  }
 
   // perform the export
   int res = fp( aShape, aFileName, aFormatName );
 
   // unload plugin library
-  UnLoadLib( anExportLib );
+  // commented by enk:
+  // the bug was occured: using ACIS Import/Export plugin
+  // UnLoadLib( anExportLib );
+
   if ( res )
     log.SetTouched(Label());