Gui: Check for every VP expiration in TaskAttacher
This commit is contained in:
committed by
Chris Hennes
parent
39d39f34c3
commit
5bf0e30676
@@ -230,7 +230,7 @@ TaskAttacher::TaskAttacher(Gui::ViewProviderDocumentObject* ViewProvider, QWidge
|
||||
continue;
|
||||
}
|
||||
|
||||
modifiedPlaneViewProviders.push_back(planeViewProvider);
|
||||
modifiedPlaneViewProviders.emplace_back(planeViewProvider);
|
||||
|
||||
planeViewProvider->setTemporaryScale(ViewParams::instance()->getDatumTemporaryScaleFactor());
|
||||
planeViewProvider->setLabelVisibility(true);
|
||||
@@ -267,7 +267,16 @@ TaskAttacher::~TaskAttacher()
|
||||
connectDelObject.disconnect();
|
||||
connectDelDocument.disconnect();
|
||||
|
||||
for (auto planeViewProvider : modifiedPlaneViewProviders) {
|
||||
for (auto& vp : modifiedPlaneViewProviders) {
|
||||
if (vp.expired()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
auto planeViewProvider = vp.get<Gui::ViewProviderPlane>();
|
||||
if (!planeViewProvider) {
|
||||
return;
|
||||
}
|
||||
|
||||
planeViewProvider->resetTemporarySize();
|
||||
planeViewProvider->setLabelVisibility(false);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define GUI_TASKVIEW_TaskAttacher_H
|
||||
|
||||
#include <Gui/Selection/Selection.h>
|
||||
#include <Gui/DocumentObserver.h>
|
||||
#include <Gui/ViewProviderDocumentObject.h>
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
#include <Gui/TaskView/TaskDialog.h>
|
||||
@@ -159,7 +160,7 @@ private:
|
||||
Connection connectDelObject;
|
||||
Connection connectDelDocument;
|
||||
|
||||
std::vector<Gui::ViewProviderPlane*> modifiedPlaneViewProviders;
|
||||
std::vector<Gui::ViewProviderWeakPtrT> modifiedPlaneViewProviders;
|
||||
|
||||
App::PropertyOverrideContext overrides;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user