Tim,
> could the following two lines cause the issue?
>
> hpx::apply<server::Block::receiveImage_action>(recipient, this->image);
> delete this;
>
> Basically, we're invoking a fire and forget action with a member
> variable (which will be serialized) as parameter. Afterwards, the
> instance is directly deleted. I guess the serialization/parameter
> transmission of the action does not happen right away and we're deleting
> the send buffer too early.
>
> How can we know - without using async() and waiting for the future -
> that the "fire part" of fire and forget has been completed and we can
> delete the send buffer?
You might want to do this instead:
hpx::apply_cb<server::Block::receiveImage_action>(
recipient,
[this]() mutable { delete this; }
this->image);
instead.
hpx::apply_cb calls the supplied function whenever it's safe to release the
data.
Regards Hartmut
---------------
http://boost-spirit.com
http://stellar.cct.lsu.edu
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users