Core: Fix several coverity issues:
* CID 350582: Big parameter passed by value * CID 350639: Big parameter passed by value * CID 305234: Uncaught exception * CID 316529: Uncaught exception * CID 350597: Uncaught exception * CID 350623: Uncaught exception * CID 332690: Uncaught exception * CID 332700: Unchecked return value * CID 350576: Uninitialized scalar field * CID 350587: Uninitialized scalar variable * CID 192606: Uninitialized scalar field * CID 332699: Uninitialized pointer field * CID 350561: Dereference null return value * CID 350610: Dereference null return value * CID 350567: Dereference after null check
This commit is contained in:
@@ -367,14 +367,7 @@ TaskDialogPython::~TaskDialogPython()
|
||||
Content.clear();
|
||||
|
||||
Base::PyGILStateLocker lock;
|
||||
|
||||
// The widgets stored in the 'form' attribute will be deleted.
|
||||
// Thus, set this attribute to None to make sure that when using
|
||||
// the same dialog instance for a task panel won't segfault.
|
||||
if (this->dlg.hasAttr(std::string("form"))) {
|
||||
this->dlg.setAttr(std::string("form"), Py::None());
|
||||
}
|
||||
this->dlg = Py::None();
|
||||
clearForm();
|
||||
|
||||
// Assigning None to 'dlg' may destroy some of the stored widgets.
|
||||
// By guarding them with QPointer their pointers will be set to null
|
||||
@@ -382,6 +375,22 @@ TaskDialogPython::~TaskDialogPython()
|
||||
Content.insert(Content.begin(), guarded.begin(), guarded.end());
|
||||
}
|
||||
|
||||
void TaskDialogPython::clearForm()
|
||||
{
|
||||
try {
|
||||
// The widgets stored in the 'form' attribute will be deleted.
|
||||
// Thus, set this attribute to None to make sure that when using
|
||||
// the same dialog instance for a task panel won't segfault.
|
||||
if (this->dlg.hasAttr(std::string("form"))) {
|
||||
this->dlg.setAttr(std::string("form"), Py::None());
|
||||
}
|
||||
this->dlg = Py::None();
|
||||
}
|
||||
catch (Py::AttributeError& e) {
|
||||
e.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void TaskDialogPython::open()
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
|
||||
Reference in New Issue
Block a user