FGBindings doesn't create its own, detached copy of the bindings property
subtree. Keeping bindings available is in the responsibility of the caller.
This commit is contained in:
parent
baac4a98c9
commit
19b09cef28
1 changed files with 13 additions and 4 deletions
|
@ -610,12 +610,21 @@ FGDialog::setupObject (puObject * object, SGPropertyNode * props)
|
|||
_liveObjects.push_back(po);
|
||||
}
|
||||
|
||||
vector<SGPropertyNode_ptr> nodes = props->getChildren("binding");
|
||||
if (nodes.size() > 0) {
|
||||
SGPropertyNode * dest = fgGetNode("/sim/bindings", true);
|
||||
vector<SGPropertyNode_ptr> bindings = props->getChildren("binding");
|
||||
if (bindings.size() > 0) {
|
||||
GUIInfo * info = new GUIInfo(this);
|
||||
|
||||
for (unsigned int i = 0; i < nodes.size(); i++)
|
||||
info->bindings.push_back(new FGBinding(nodes[i]));
|
||||
for (unsigned int i = 0; i < bindings.size(); i++) {
|
||||
unsigned int j = 0;
|
||||
SGPropertyNode *binding;
|
||||
while (dest->getChild("binding", j))
|
||||
j++;
|
||||
|
||||
binding = dest->getChild("binding", j, true);
|
||||
copyProperties(bindings[i], binding);
|
||||
info->bindings.push_back(new FGBinding(binding));
|
||||
}
|
||||
object->setCallback(action_callback);
|
||||
object->setUserData(info);
|
||||
_info.push_back(info);
|
||||
|
|
Loading…
Reference in a new issue