1
0
Fork 0

Fix another (tiny) memory leak.

SGCloudField::addCloud does *not* keep a reference to SGNewCloud - so we
only need a temporary object. Also adapt to changed addCloud interface
to make things a little more obvious.
This commit is contained in:
ThorstenB 2011-03-07 19:34:52 +01:00
parent ae8438333c
commit 4761a3cdcf

View file

@ -162,8 +162,8 @@ double FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_
double bottom_shade = cld_def->getDoubleValue("bottom-shade", 1.0);
string texture = cld_def->getStringValue("texture", "cu.png");
SGNewCloud *cld =
new SGNewCloud(type,
SGNewCloud cld =
SGNewCloud(type,
texture_root,
texture,
min_width,
@ -178,7 +178,7 @@ double FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_
num_sprites,
num_textures_x,
num_textures_y);
layer->addCloud(newpos, cld);
layer->addCloud(newpos, cld.genCloud());
}
}
}