fix a segfault caused by re-entrance
at the point when we're connecting a new node to the UI-Bus, the new node's BusTerm is not yet initialised, since we need the uplink connection we're about to create for setting up this BusTerm. Consequently, the new nodes's ID is not yet initialised, so we need to pass this endpoint-ID explicitly to the registration function.
This commit is contained in:
parent
38e6d635dc
commit
972045d8f8
3 changed files with 8 additions and 6 deletions
|
|
@ -87,7 +87,7 @@ namespace ctrl {
|
|||
BusTerm
|
||||
BusTerm::attach (ID identity, Tangible& newNode)
|
||||
{
|
||||
return BusTerm(identity, theBus_.routeAdd(newNode));
|
||||
return BusTerm(identity, theBus_.routeAdd (identity,newNode));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -161,9 +161,9 @@ namespace ctrl {
|
|||
* @return corresponding up-link for the initiating node to use
|
||||
*/
|
||||
BusTerm&
|
||||
BusTerm::routeAdd (Tangible& node)
|
||||
BusTerm::routeAdd (ID identity, Tangible& node)
|
||||
{
|
||||
return theBus_.routeAdd(node);
|
||||
return theBus_.routeAdd (identity, node);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ namespace ctrl{
|
|||
, theBus_(attached_to)
|
||||
{ }
|
||||
|
||||
virtual BusTerm& routeAdd(Tangible&);
|
||||
virtual BusTerm& routeAdd(ID,Tangible&);
|
||||
virtual void routeDetach(ID) noexcept;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -99,13 +99,15 @@ namespace ctrl{
|
|||
}
|
||||
|
||||
/** add a new down-link connection to the routing table
|
||||
* @param identity the [endpoint-ID][BusTerm::endpointID_] used
|
||||
* to address the new element to be connected to the bus.
|
||||
* @return backlink for the new Tangible's BusTerm to
|
||||
* attach itself to the Nexus.
|
||||
*/
|
||||
virtual BusTerm&
|
||||
routeAdd (Tangible& newNode) override
|
||||
routeAdd (ID identity, Tangible& newNode) override
|
||||
{
|
||||
routingTable_[newNode] = &newNode;
|
||||
routingTable_[identity] = &newNode;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue