Fem: use WeakPtrT classes instead of raw pointers to avoid possible dangling pointers and to avoid undefined behaviour if a wrong static_cast is performed

This commit is contained in:
wmayer
2022-06-13 14:21:18 +02:00
parent cf321ef481
commit 82b8ddc042
2 changed files with 26 additions and 14 deletions

View File

@@ -212,7 +212,8 @@ ViewProviderDataMarker::~ViewProviderDataMarker()
// ***************************************************************************
TaskDlgPost::TaskDlgPost(Gui::ViewProviderDocumentObject* view)
: TaskDialog(), m_view(view)
: TaskDialog()
, m_view(view)
{
assert(view);
}
@@ -289,10 +290,10 @@ void TaskDlgPost::modifyStandardButtons(QDialogButtonBox* box) {
// ***************************************************************************
// some task box methods
TaskPostBox::TaskPostBox(Gui::ViewProviderDocumentObject* view, const QPixmap& icon, const QString& title, QWidget* parent)
: TaskBox(icon, title, true, parent) {
m_view = view;
m_object = view->getObject();
: TaskBox(icon, title, true, parent)
, m_object(view->getObject())
, m_view(view)
{
}
TaskPostBox::~TaskPostBox() {