diff options
author | Marcus Müller <marcus@hostalia.de> | 2017-06-24 23:30:42 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2017-06-24 23:30:42 +0200 |
commit | a16ed67b5dae099c6ac1447c000f15765b13422f (patch) | |
tree | 3e9047b87b9a64720745057a089b24a518f4b2d4 /gnuradio-runtime/lib/controlport/rpcserver_aggregator.cc | |
parent | b57a37f7c676542f08a27d3f141f4d9ed2ab1132 (diff) |
Fixed storing references to temporary values in RPC infrastructure
The RPC aggregator and friends were taking callback objects passed by
value, and then internally called, again by value, constructors which
initialized reference fields to these parameters.
This has the effect of storing references to temporary objects. Chances
are, no-one is using that code, or compiler UB saved our collective
behinds.
In any case, we might need to more carefully dissect the RPC code. There
be dragons.
Diffstat (limited to 'gnuradio-runtime/lib/controlport/rpcserver_aggregator.cc')
-rw-r--r-- | gnuradio-runtime/lib/controlport/rpcserver_aggregator.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gnuradio-runtime/lib/controlport/rpcserver_aggregator.cc b/gnuradio-runtime/lib/controlport/rpcserver_aggregator.cc index e81a899626..f546c2daab 100644 --- a/gnuradio-runtime/lib/controlport/rpcserver_aggregator.cc +++ b/gnuradio-runtime/lib/controlport/rpcserver_aggregator.cc @@ -47,7 +47,7 @@ rpcserver_aggregator::registeredServers() void rpcserver_aggregator::registerConfigureCallback(const std::string &id, - const configureCallback_t callback) + const configureCallback_t &callback) { std::for_each(d_serverlist.begin(), d_serverlist.end(), registerConfigureCallback_f<rpcmanager_base::rpcserver_booter_base_sptr, configureCallback_t>(id, callback)); @@ -61,7 +61,7 @@ rpcserver_aggregator::unregisterConfigureCallback(const std::string &id) } void -rpcserver_aggregator::registerQueryCallback(const std::string &id, const queryCallback_t callback) +rpcserver_aggregator::registerQueryCallback(const std::string &id, const queryCallback_t &callback) { std::for_each(d_serverlist.begin(), d_serverlist.end(), registerQueryCallback_f<rpcmanager_base::rpcserver_booter_base_sptr, queryCallback_t>(id, callback)); @@ -78,7 +78,7 @@ rpcserver_aggregator::unregisterQueryCallback(const std::string &id) void rpcserver_aggregator::registerHandlerCallback(const std::string &id, - const handlerCallback_t callback) + const handlerCallback_t &callback) { std::for_each(d_serverlist.begin(), d_serverlist.end(), registerHandlerCallback_f<rpcmanager_base::rpcserver_booter_base_sptr, handlerCallback_t>(id, callback)); |