Try to avoid some memory leaks.
This commit is contained in:
parent
fb54e9e103
commit
1341b5b9f8
@ -50,7 +50,9 @@ SGCloudLayer::SGCloudLayer( const string &tex_path )
|
||||
}
|
||||
|
||||
// Destructor
|
||||
SGCloudLayer::~SGCloudLayer( void ) {
|
||||
SGCloudLayer::~SGCloudLayer()
|
||||
{
|
||||
delete layer_root;
|
||||
}
|
||||
|
||||
float
|
||||
@ -62,7 +64,10 @@ SGCloudLayer::getSpan_m () const
|
||||
void
|
||||
SGCloudLayer::setSpan_m (float span_m)
|
||||
{
|
||||
if (span_m != layer_span) {
|
||||
layer_span = span_m;
|
||||
rebuild();
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
@ -110,8 +115,10 @@ SGCloudLayer::getType () const
|
||||
void
|
||||
SGCloudLayer::setType (Type type)
|
||||
{
|
||||
if (type != layer_type) {
|
||||
layer_type = type;
|
||||
rebuild();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -143,7 +150,11 @@ SGCloudLayer::rebuild()
|
||||
layer_states[SG_CLOUD_CLEAR] = 0;
|
||||
}
|
||||
|
||||
// This should automatically delete
|
||||
// layer_transform as well.
|
||||
delete layer_root;
|
||||
layer_root = 0;
|
||||
layer_transform = 0;
|
||||
|
||||
scale = 4000.0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user