Skip to content
Snippets Groups Projects
Commit 19b49efa authored by Marco Biasini's avatar Marco Biasini
Browse files

properly initialise AtomImpl properties

parent 08528947
No related branches found
No related tags found
No related merge requests found
...@@ -45,12 +45,16 @@ AtomImpl::AtomImpl(const EntityImplPtr& e, ...@@ -45,12 +45,16 @@ AtomImpl::AtomImpl(const EntityImplPtr& e,
res_(r), res_(r),
name_(n), name_(n),
pos_(p), pos_(p),
occupancy_(0.0),
b_factor_(1.0),
prop_(NULL),
is_hetatm_(false),
element_(ele), element_(ele),
is_hetatm_(false),
prim_connector_(), prim_connector_(),
connector_list_(), connector_list_(),
fragment_(), fragment_(),
state_(0), state_(0),
index_(index) index_(index)
{ {
EntityHandle ent = this->GetEntity(); EntityHandle ent = this->GetEntity();
...@@ -206,6 +210,10 @@ void AtomImpl::UpdateFromXCS() ...@@ -206,6 +210,10 @@ void AtomImpl::UpdateFromXCS()
} }
AtomImpl::~AtomImpl() { AtomImpl::~AtomImpl() {
if (prop_ && !prop_->is_default) {
delete prop_;
prop_=NULL;
}
} }
EntityImplPtr AtomImpl::GetEntity() const EntityImplPtr AtomImpl::GetEntity() const
......
...@@ -227,9 +227,9 @@ private: ...@@ -227,9 +227,9 @@ private:
geom::Vec3 tf_pos_; geom::Vec3 tf_pos_;
Real occupancy_; Real occupancy_;
Real b_factor_; Real b_factor_;
String element_;
AtomProp* prop_; AtomProp* prop_;
bool is_hetatm_; bool is_hetatm_;
String element_;
ConnectorImplP prim_connector_; ConnectorImplP prim_connector_;
ConnectorImplList connector_list_; ConnectorImplList connector_list_;
FragmentImplP fragment_; FragmentImplP fragment_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment