Coverity Fixes
*** CID 153360: Control flow issues (UNREACHABLE) *** CID 153359: Uninitialized members (UNINIT_CTOR) *** CID 153358: Resource leaks (RESOURCE_LEAK) *** CID 153354: Null pointer dereferences (FORWARD_NULL)
This commit is contained in:
committed by
Yorik van Havre
parent
0356da3882
commit
1e66add845
@@ -328,8 +328,10 @@ int DrawProjGroup::purgeProjections()
|
||||
DrawProjGroupItem* dpgi;
|
||||
DocumentObject* dObj = views.back();
|
||||
dpgi = dynamic_cast<DrawProjGroupItem*>(dObj);
|
||||
std::string itemName = dpgi->Type.getValueAsString();
|
||||
removeProjection(itemName.c_str());
|
||||
if (dpgi) {
|
||||
std::string itemName = dpgi->Type.getValueAsString();
|
||||
removeProjection(itemName.c_str());
|
||||
}
|
||||
}
|
||||
return Views.getValues().size();
|
||||
}
|
||||
|
||||
@@ -89,7 +89,10 @@ DrawProjGroupItem::~DrawProjGroupItem()
|
||||
void DrawProjGroupItem::onDocumentRestored()
|
||||
{
|
||||
setAutoPos(false); //if restoring from file, use X,Y from file, not auto!
|
||||
DrawProjGroupItem::execute();
|
||||
App::DocumentObjectExecReturn* rc = DrawProjGroupItem::execute();
|
||||
if (rc) {
|
||||
delete rc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -131,10 +131,10 @@ short DrawView::mustExecute() const
|
||||
Scale.isTouched() ||
|
||||
ScaleType.isTouched() );
|
||||
}
|
||||
if (result) {
|
||||
if ((bool) result) {
|
||||
return result;
|
||||
}
|
||||
return App::DocumentObject::mustExecute();
|
||||
return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
////you must override this in derived class
|
||||
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
const char * viewChkIndexToCStr(int index);
|
||||
|
||||
protected:
|
||||
ViewProviderProjGroup *viewProvider;
|
||||
//ViewProviderProjGroup *viewProvider;
|
||||
TechDraw::DrawProjGroup* multiView;
|
||||
bool m_createMode;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user