Closed pauloloid closed 8 years ago
sendMessage
uses QByteArray
. Try to use getImageCapture().buffer()
If the problem still persists this could mean that there actually is a memory leak in nzmqt. I have heard similar problems from a user. However, I rarely send huge amounts of data so the error may cumulate not as fast as for you.
Looking at ZMQMessage
it definitely copies data before sending (why?) https://github.com/jonnydee/nzmqt/blob/8f71eac671eef8444c8307deeb955a0b3acb7e5a/include/nzmqt/impl.hpp#L70
@jonnydee where is this data freed?
Hello,
I am sorry, I just recognized, it does not have something to do with ZeroMQ or nzmqt.
The way I got my QImage (by signal and slot) was designed wrong.
Anyway, thank you for your fast response!
Yes, implementation looks correct. zmq frees the message_t
automatically. However, you may consider constructing your own ZMQMessage
objects in order to minimize overhead.
Hello,
I use the NZMQTINLINE bool ZMQSocket::sendMessage(const QByteArray& bytes, SendFlags flags_) function for sending a QByteArray of an QImage.
So I call
socket_->sendMessage(getImageCapture());
where getImageCapture() is:Everytime the memory increases. After a certain time I get a stackoverflow.
How can I handle this?