Memory leak fixes from Till Busch
This commit is contained in:
parent
d15229a835
commit
1b439f8501
4 changed files with 22 additions and 24 deletions
|
@ -818,17 +818,13 @@ bool FGXMLAutopilot::build() {
|
|||
string name = node->getName();
|
||||
// cout << name << endl;
|
||||
if ( name == "pid-controller" ) {
|
||||
FGXMLAutoComponent *c = new FGPIDController( node );
|
||||
components.push_back( c );
|
||||
components.push_back( new FGPIDController( node ) );
|
||||
} else if ( name == "pi-simple-controller" ) {
|
||||
FGXMLAutoComponent *c = new FGPISimpleController( node );
|
||||
components.push_back( c );
|
||||
components.push_back( new FGPISimpleController( node ) );
|
||||
} else if ( name == "predict-simple" ) {
|
||||
FGXMLAutoComponent *c = new FGPredictor( node );
|
||||
components.push_back( c );
|
||||
components.push_back( new FGPredictor( node ) );
|
||||
} else if ( name == "filter" ) {
|
||||
FGXMLAutoComponent *c = new FGDigitalFilter( node );
|
||||
components.push_back( c );
|
||||
components.push_back( new FGDigitalFilter( node ) );
|
||||
} else {
|
||||
SG_LOG( SG_ALL, SG_ALERT, "Unknown top level section: "
|
||||
<< name );
|
||||
|
|
|
@ -52,7 +52,7 @@ SG_USING_STD(deque);
|
|||
* Base class for other autopilot components
|
||||
*/
|
||||
|
||||
class FGXMLAutoComponent {
|
||||
class FGXMLAutoComponent : public SGReferenced {
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -275,7 +275,7 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
typedef vector<FGXMLAutoComponent *> comp_list;
|
||||
typedef vector<SGSharedPtr<FGXMLAutoComponent> > comp_list;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -813,11 +813,11 @@ FGDialog::setColor(puObject * object, SGPropertyNode * props, int which)
|
|||
if (type == "textbox" && props->getBoolValue("editable"))
|
||||
type += "-editable";
|
||||
|
||||
FGColor *c = new FGColor(_gui->getColor("background"));
|
||||
c->merge(_gui->getColor(type));
|
||||
c->merge(props->getNode("color"));
|
||||
if (c->isValid())
|
||||
object->setColourScheme(c->red(), c->green(), c->blue(), c->alpha());
|
||||
FGColor c(_gui->getColor("background"));
|
||||
c.merge(_gui->getColor(type));
|
||||
c.merge(props->getNode("color"));
|
||||
if (c.isValid())
|
||||
object->setColourScheme(c.red(), c.green(), c.blue(), c.alpha());
|
||||
|
||||
const struct {
|
||||
int mask;
|
||||
|
@ -840,20 +840,20 @@ FGDialog::setColor(puObject * object, SGPropertyNode * props, int which)
|
|||
|
||||
for (int i = 0; i < numcol; i++) {
|
||||
bool dirty = false;
|
||||
c->clear();
|
||||
c->setAlpha(1.0);
|
||||
c.clear();
|
||||
c.setAlpha(1.0);
|
||||
|
||||
dirty |= c->merge(_gui->getColor(type + '-' + pucol[i].name));
|
||||
dirty |= c.merge(_gui->getColor(type + '-' + pucol[i].name));
|
||||
if (which & pucol[i].mask)
|
||||
dirty |= c->merge(props->getNode("color"));
|
||||
dirty |= c.merge(props->getNode("color"));
|
||||
|
||||
if ((pucol[i].mask == LABEL) && !c->isValid())
|
||||
dirty |= c->merge(_gui->getColor("label"));
|
||||
if ((pucol[i].mask == LABEL) && !c.isValid())
|
||||
dirty |= c.merge(_gui->getColor("label"));
|
||||
|
||||
dirty |= c->merge(props->getNode(pucol[i].cname));
|
||||
dirty |= c.merge(props->getNode(pucol[i].cname));
|
||||
|
||||
if (c->isValid() && dirty)
|
||||
object->setColor(pucol[i].id, c->red(), c->green(), c->blue(), c->alpha());
|
||||
if (c.isValid() && dirty)
|
||||
object->setColor(pucol[i].id, c.red(), c.green(), c.blue(), c.alpha());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1124,6 +1124,8 @@ FGInput::mouse_mode::~mouse_mode ()
|
|||
FGInput::mouse::mouse ()
|
||||
: x(-1),
|
||||
y(-1),
|
||||
save_x(-1),
|
||||
save_y(-1),
|
||||
nModes(1),
|
||||
current_mode(0),
|
||||
modes(0)
|
||||
|
|
Loading…
Reference in a new issue