Remove color bar from SoFCColorBarNotifier to decrease reference counter
This commit is contained in:
@@ -115,9 +115,7 @@ ViewProviderInspection::~ViewProviderInspection()
|
||||
pcCoords->unref();
|
||||
pcMatBinding->unref();
|
||||
pcColorMat->unref();
|
||||
Gui::SoFCColorBarNotifier::instance().detach(pcColorBar);
|
||||
pcColorBar->Detach(this);
|
||||
pcColorBar->unref();
|
||||
deleteColorBar();
|
||||
pcLinkRoot->unref();
|
||||
pcPointStyle->unref();
|
||||
}
|
||||
@@ -150,6 +148,13 @@ void ViewProviderInspection::show()
|
||||
pcColorStyle->style = SoDrawStyle::FILLED;
|
||||
}
|
||||
|
||||
void ViewProviderInspection::deleteColorBar()
|
||||
{
|
||||
Gui::SoFCColorBarNotifier::instance().detach(pcColorBar);
|
||||
pcColorBar->Detach(this);
|
||||
pcColorBar->unref();
|
||||
}
|
||||
|
||||
void ViewProviderInspection::attach(App::DocumentObject* pcFeat)
|
||||
{
|
||||
// creates the standard viewing modes
|
||||
@@ -185,8 +190,7 @@ void ViewProviderInspection::attach(App::DocumentObject* pcFeat)
|
||||
pcBar->ref();
|
||||
pcBar->setRange(fMin, fMax, 3);
|
||||
pcBar->Notify(0);
|
||||
pcColorBar->Detach(this);
|
||||
pcColorBar->unref();
|
||||
deleteColorBar();
|
||||
pcColorBar = pcBar;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,8 +94,9 @@ private:
|
||||
void setupNormals(const std::vector<Base::Vector3f>&);
|
||||
void setupLineIndexes(const std::vector<Data::ComplexGeoData::Line>&);
|
||||
void setupFaceIndexes(const std::vector<Data::ComplexGeoData::Facet>&);
|
||||
void deleteColorBar();
|
||||
|
||||
protected:
|
||||
private:
|
||||
SoMaterial* pcColorMat;
|
||||
SoMaterialBinding* pcMatBinding;
|
||||
SoGroup* pcLinkRoot;
|
||||
|
||||
Reference in New Issue
Block a user