Remove color bar from SoFCColorBarNotifier to decrease reference counter
This commit is contained in:
@@ -126,9 +126,7 @@ ViewProviderMeshCurvature::~ViewProviderMeshCurvature()
|
||||
{
|
||||
pcColorRoot->unref();
|
||||
pcColorMat->unref();
|
||||
Gui::SoFCColorBarNotifier::instance().detach(pcColorBar);
|
||||
pcColorBar->Detach(this);
|
||||
pcColorBar->unref();
|
||||
deleteColorBar();
|
||||
pcLinkRoot->unref();
|
||||
}
|
||||
|
||||
@@ -237,12 +235,19 @@ void ViewProviderMeshCurvature::slotChangedObject(const App::DocumentObject& Obj
|
||||
const Mesh::MeshObject& kernel = mesh.getValue();
|
||||
pcColorMat->diffuseColor.setNum((int)kernel.countPoints());
|
||||
pcColorMat->transparency.setNum((int)kernel.countPoints());
|
||||
static_cast<Mesh::Curvature*>(pcObject)
|
||||
->Source.touch(); // make sure to recompute the feature
|
||||
// make sure to recompute the feature
|
||||
static_cast<Mesh::Curvature*>(pcObject)->Source.touch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::deleteColorBar()
|
||||
{
|
||||
Gui::SoFCColorBarNotifier::instance().detach(pcColorBar);
|
||||
pcColorBar->Detach(this);
|
||||
pcColorBar->unref();
|
||||
}
|
||||
|
||||
void ViewProviderMeshCurvature::attach(App::DocumentObject* pcFeat)
|
||||
{
|
||||
// creates the standard viewing modes
|
||||
@@ -281,8 +286,7 @@ void ViewProviderMeshCurvature::attach(App::DocumentObject* pcFeat)
|
||||
pcBar->ref();
|
||||
pcBar->setRange(fMin, fMax, 3);
|
||||
pcBar->Notify(0);
|
||||
pcColorBar->Detach(this);
|
||||
pcColorBar->unref();
|
||||
deleteColorBar();
|
||||
pcColorBar = pcBar;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user