Memory leak if libzt events aren't consumed by user app
If arg is not enqueued by Events, then treat as if ownership has NOT
been transferred and caller of Events->enqueue is responsible for freeing
This commit is contained in:
Brenton Bostick
2023-08-21 11:50:05 -04:00
parent f5ffc062e9
commit ee5047b59a
4 changed files with 90 additions and 17 deletions

View File

@@ -115,8 +115,12 @@ class Events {
/**
* Enqueue an event to be sent to the user application
*
* Returns true if arg was enqueued.
* If enqueued, then ownership of arg has been transferred.
* If NOT enqueued, then ownership of arg has NOT been transferred.
*/
void enqueue(unsigned int event_code, const void* arg, int len = 0);
bool enqueue(unsigned int event_code, const void* arg, int len = 0);
/**
* Send callback message to user application