Make it possible to have a Variable not belonging to any LinearSpec.
This commit is contained in:
parent
bc7956c7cf
commit
0a408e4992
@ -93,6 +93,9 @@ LinearSpec::AddVariable(Variable* variable)
|
||||
if (!fVariables.AddItem(variable))
|
||||
return false;
|
||||
|
||||
if (variable->fLS == NULL)
|
||||
variable->fLS = this;
|
||||
|
||||
if (!fSolver->VariableAdded(variable)) {
|
||||
fVariables.RemoveItem(variable);
|
||||
return false;
|
||||
|
@ -325,6 +325,7 @@ Variable::RemoveReference()
|
||||
*/
|
||||
Variable::~Variable()
|
||||
{
|
||||
fLS->RemoveVariable(this, false);
|
||||
if (fLS)
|
||||
fLS->RemoveVariable(this, false);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user