Skip to content

Commit

Permalink
Coverity: fix high impact issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Aug 17, 2016
1 parent 9b013f7 commit d98337b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/Main/MainCmd.cpp
Expand Up @@ -138,8 +138,12 @@ int main( int argc, char ** argv )
// Destruction phase ===========================================================
Console().Log("FreeCAD terminating...\n");

// close open documents
App::GetApplication().closeAllDocuments();
try {
// close open documents
App::GetApplication().closeAllDocuments();
}
catch(...) {
}

// cleans up
Application::destruct();
Expand Down
1 change: 1 addition & 0 deletions src/Main/MainPy.cpp
Expand Up @@ -118,6 +118,7 @@ extern "C"
Dl_info info;
int ret = dladdr((void*)initFreeCAD, &info);
if ((ret == 0) || (!info.dli_fname)) {
free(argv);
PyErr_SetString(PyExc_ImportError, "Cannot get path of the FreeCAD module!");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Drawing/App/FeatureViewSpreadsheet.cpp
Expand Up @@ -180,7 +180,7 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
celltext = field.str();
}
// get colors, style, alignment and span
int alignment;
int alignment = 0;
std::string bcolor = "none";
std::string fcolor = "#" + hr.str() + hg.str() + hb.str();
std::string textstyle = "";
Expand Down
6 changes: 2 additions & 4 deletions src/Mod/Fem/App/AppFemPy.cpp
Expand Up @@ -140,8 +140,7 @@ class Module : public Py::ExtensionModule<Module>
FemMeshObject *pcFeature = static_cast<FemMeshObject *>
(pcDoc->addObject("Fem::FemMeshObject", file.fileNamePure().c_str()));
pcFeature->Label.setValue(file.fileNamePure().c_str());
pcFeature->FemMesh.setValuePtr(mesh.get());
(void)mesh.release();
pcFeature->FemMesh.setValuePtr(mesh.release());
pcFeature->purgeTouched();

return Py::None();
Expand Down Expand Up @@ -175,8 +174,7 @@ class Module : public Py::ExtensionModule<Module>
FemMeshObject *pcFeature = static_cast<FemMeshObject *>
(pcDoc->addObject("Fem::FemMeshObject", file.fileNamePure().c_str()));
pcFeature->Label.setValue(file.fileNamePure().c_str());
pcFeature->FemMesh.setValuePtr(mesh.get());
(void)mesh.release();
pcFeature->FemMesh.setValuePtr(mesh.release());
pcFeature->purgeTouched();
}
catch(Base::Exception& e) {
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/PartDesign/Gui/ViewProviderPrimitive.cpp
Expand Up @@ -56,7 +56,7 @@ PROPERTY_SOURCE(PartDesignGui::ViewProviderPrimitive,PartDesignGui::ViewProvider

ViewProviderPrimitive::ViewProviderPrimitive()
{

previewFaceSet = 0;
}

ViewProviderPrimitive::~ViewProviderPrimitive()
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
Expand Up @@ -2698,7 +2698,7 @@ void ViewProviderSketch::drawMergedConstraintIcons(IconQueue iconQueue)

// Tracks all constraint IDs that are combined into this icon
QString idString;
int lastVPad;
int lastVPad = 0;

QStringList labels;
std::vector<int> ids;
Expand Down

0 comments on commit d98337b

Please sign in to comment.