Re: Help me wrap PahoMQTT
- Posted by petelomax Apr 10, 2019
- 2762 views
xfox26 said...
I'm asking about the MQTTClient_freeMessage part, where I do allocate, poke the pointer and call the function passing a pointer to the pointer... feels so wrong...
And, there is some simple way to test if there are a memory leak somewhere?
Given that (in C) void MQTTClient_freeMessage(MQTTClient_message** msg) means it is asking for a pointer to a pointer to msg, looks about right to me.
Apart from running taskmanager and seeing whether memory use just keeps on growing, if MQTTClinet_freeMessage(NULL) crashes then it is pretty likely anything non-crashing has got it right.