diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 51269d7d5c..bf5220cd30 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -1283,7 +1283,11 @@ Document::~Document() Console().Log("-App::Document: %s %p\n",getName(), this); #endif - clearUndos(); + try { + clearUndos(); + } + catch (const boost::exception&) { + } std::map::iterator it; diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index 5d3a6508c5..4ad3d77845 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -610,9 +610,12 @@ PyObject* Application::sGetMainWindow(PyObject * /*self*/, PyObject *args) return NULL; PythonWrapper wrap; - wrap.loadCoreModule(); - wrap.loadGuiModule(); - wrap.loadWidgetsModule(); + if (!wrap.loadCoreModule() || + !wrap.loadGuiModule() || + !wrap.loadWidgetsModule()) { + PyErr_SetString(PyExc_RuntimeError, "Failed to load Python wrapper for Qt"); + return 0; + } try { return Py::new_reference_to(wrap.fromQWidget(Gui::getMainWindow(), "QMainWindow")); } diff --git a/src/Gui/DlgPropertyLink.cpp b/src/Gui/DlgPropertyLink.cpp index 8cd35cf15e..da8b011ebc 100644 --- a/src/Gui/DlgPropertyLink.cpp +++ b/src/Gui/DlgPropertyLink.cpp @@ -158,7 +158,7 @@ void DlgPropertyLink::findObjects(bool on, const QString& searchText) std::vector ignoreList; App::DocumentObject* par = doc->getObject((const char*)parName.toLatin1()); App::Property* prop = par->getPropertyByName((const char*)proName.toLatin1()); - if (par) { + if (prop) { // for multi-selection we need all objects if (isSingleSelection) { ignoreList = par->getOutListOfProperty(prop); diff --git a/src/Gui/NaviCube.cpp b/src/Gui/NaviCube.cpp index 5e7cc58110..fad94f4e2d 100644 --- a/src/Gui/NaviCube.cpp +++ b/src/Gui/NaviCube.cpp @@ -964,16 +964,16 @@ void NaviCubeImplementation::drawNaviCube(bool pickMode) { else { for (int pass = 0; pass < 3 ; pass++) { for (vector::iterator f = m_Faces.begin(); f != m_Faces.end(); f++) { - if (pickMode) { // pick should not be drawn in tree passes - glColor3ub((*f)->m_PickId, 0, 0); - glBindTexture(GL_TEXTURE_2D, (*f)->m_PickTextureId); - } else { + //if (pickMode) { // pick should not be drawn in tree passes + // glColor3ub((*f)->m_PickId, 0, 0); + // glBindTexture(GL_TEXTURE_2D, (*f)->m_PickTextureId); + //} else { if (pass != (*f)->m_RenderPass) continue; QColor& c = (m_HiliteId == (*f)->m_PickId) && (pass < 2) ? m_HiliteColor : (*f)->m_Color; glColor4f(c.redF(), c.greenF(), c.blueF(),c.alphaF()); glBindTexture(GL_TEXTURE_2D, (*f)->m_TextureId); - } + //} glDrawElements(GL_TRIANGLE_FAN, (*f)->m_VertexCount, GL_UNSIGNED_BYTE, (void*) &m_IndexArray[(*f)->m_FirstVertex]); } } diff --git a/src/Mod/Draft/App/dxf.cpp b/src/Mod/Draft/App/dxf.cpp index a8319600b1..3d41ee72e0 100644 --- a/src/Mod/Draft/App/dxf.cpp +++ b/src/Mod/Draft/App/dxf.cpp @@ -687,7 +687,7 @@ bool CDxfRead::ReadSpline() bool CDxfRead::ReadCircle() { double radius = 0.0; - double c[3]; // centre + double c[3] = {0,0,0}; // centre bool hidden = false; while(!((*m_ifs).eof())) @@ -845,8 +845,8 @@ bool CDxfRead::ReadText() bool CDxfRead::ReadEllipse() { - double c[3]; // centre - double m[3]; //major axis point + double c[3] = {0,0,0}; // centre + double m[3] = {0,0,0}; //major axis point double ratio=0; //ratio of major to minor axis double start=0; //start of arc double end=0; // end of arc diff --git a/src/Mod/Import/App/dxf.cpp b/src/Mod/Import/App/dxf.cpp index 8d3d9a82f8..34ecfa6037 100644 --- a/src/Mod/Import/App/dxf.cpp +++ b/src/Mod/Import/App/dxf.cpp @@ -1901,7 +1901,7 @@ bool CDxfRead::ReadArc() double start_angle = 0.0;// in degrees double end_angle = 0.0; double radius = 0.0; - double c[3]; // centre + double c[3] = {0,0,0}; // centre double z_extrusion_dir = 1.0; bool hidden = false; @@ -2182,7 +2182,7 @@ bool CDxfRead::ReadSpline() bool CDxfRead::ReadCircle() { double radius = 0.0; - double c[3]; // centre + double c[3] = {0,0,0}; // centre bool hidden = false; while(!((*m_ifs).eof())) @@ -2340,8 +2340,8 @@ bool CDxfRead::ReadText() bool CDxfRead::ReadEllipse() { - double c[3]; // centre - double m[3]; //major axis point + double c[3] = {0,0,0}; // centre + double m[3] = {0,0,0}; //major axis point double ratio=0; //ratio of major to minor axis double start=0; //start of arc double end=0; // end of arc @@ -2714,7 +2714,7 @@ bool CDxfRead::ReadPolyLine() get_line(); if (! strcmp(m_str,"VERTEX")) { - double vertex[3]; + double vertex[3] = {0,0,0}; if (CDxfRead::ReadVertex(vertex, &bulge_found, &bulge)) { if(!first_vertex_section_found) { @@ -2757,7 +2757,7 @@ bool CDxfRead::ReadPolyLine() } void CDxfRead::OnReadArc(double start_angle, double end_angle, double radius, const double* c, double z_extrusion_dir, bool hidden){ - double s[3], e[3], temp[3] ; + double s[3] = {0,0,0}, e[3] = {0,0,0}, temp[3] = {0,0,0}; if (z_extrusion_dir==1.0) { temp[0] =c[0]; @@ -2813,8 +2813,8 @@ void CDxfRead::OnReadEllipse(const double* c, const double* m, double ratio, dou bool CDxfRead::ReadInsert() { - double c[3]; // coordinate - double s[3]; // scale + double c[3] = {0,0,0}; // coordinate + double s[3] = {0,0,0}; // scale double rot = 0.0; // rotation char name[1024]; s[0] = 1.0; @@ -2908,9 +2908,9 @@ bool CDxfRead::ReadInsert() bool CDxfRead::ReadDimension() { - double s[3]; // startpoint - double e[3]; // endpoint - double p[3]; // dimpoint + double s[3] = {0,0,0}; // startpoint + double e[3] = {0,0,0}; // endpoint + double p[3] = {0,0,0}; // dimpoint double rot = -1.0; // rotation while(!((*m_ifs).eof())) diff --git a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp index 4c6af98adb..8221983295 100644 --- a/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp +++ b/src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp @@ -728,7 +728,7 @@ void SoFCIndexedFaceSet::generateGLArrays(SoGLRenderAction * action) // the nindices must have the length of numindices int32_t vertex = 0; int index = 0; - float t = transp[0]; + float t = transp ? transp[0] : 0; for (std::size_t i=0; i