Products | Versions |
---|---|
TIBCO Rendezvous | - |
Not Applicable | - |
Resolution:
This is the expected behaviour. Every time the function tibrvMsg_GetReplySubject is called, we create a copy of the reply subject and manage it until the end of the message's lifetime. The user should never free the returned memory but should be aware that if the function is repeatedly called on a single message, memory usage would grow until that message is destroyed.
This code is showing the memory growth problem:
void check(tibrv_status status)
{
if (status != TIBRV_OK)
abort();
}
int main()
{
tibrvMsg msg;
check(tibrvMsg_Create(&msg));
check(tibrvMsg_SetReplySubject(msg, "Hello.World"));
for (;;) {
char const * s;
check(tibrvMsg_GetReplySubject(msg, &s));
}
return 0;
}
If a user really needs to access the reply subject of a single message repeatedly, the APIs tibrvMsg_MarkReferences and tibrvMsg_ClearReferences can be used to manage the memory usage.