Copy callbacks by value in mxs_rworker_broadcast
Copying by reference will not work as the references will refer to the values passed to the function, not the actual callbacks.
This commit is contained in:
parent
2939779052
commit
8a248dd930
@ -1018,10 +1018,12 @@ protected:
|
||||
|
||||
size_t mxs_rworker_broadcast(void (*cb)(void* data), void* data)
|
||||
{
|
||||
return RoutingWorker::broadcast(std::auto_ptr<FunctionTask>(new FunctionTask([&]()
|
||||
std::auto_ptr<FunctionTask> task(new FunctionTask([cb, data]()
|
||||
{
|
||||
cb(data);
|
||||
})));
|
||||
}));
|
||||
|
||||
return RoutingWorker::broadcast(task);
|
||||
}
|
||||
|
||||
uint64_t mxs_rworker_create_key()
|
||||
|
Loading…
x
Reference in New Issue
Block a user