BewareMyPower opened a new pull request #14797:
URL: https://github.com/apache/pulsar/pull/14797
Fixes #509
### Motivation
When a C++ producer is created successfully, it will start a send timer.
However the callback has captured the shared pointer of `ProducerImpl`
itself. It extends the lifetime of `ProducerImpl` so that even after the
`Producer` object destructs, the underlying `ProducerImpl` object won't
be destructed. It could only be destructed after `Client::close()` is
called.
### Modifications
- Pass a weak pointer of `ProducerImpl` to the send timer and add a
`asyncWaitSendTimeout` method for the combination of
`expires_from_now` and `async_wait` calls on the timer.
- Add `ClientTest.testReferenceCount` to verify the reference count will
become 0 after the producer or consumer destructs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]