Merge pull request #4601 from pan-/fix_memory_pool_destructor

rtos: Fix MemoryPool and Queue destructor
pull/4636/head
Jimmy Brisson 2017-06-29 11:07:38 -05:00 committed by GitHub
commit 2ffd264bba
2 changed files with 9 additions and 0 deletions

View File

@ -58,6 +58,11 @@ public:
MBED_ASSERT(_id);
}
/** Destroy a memory pool */
~MemoryPool() {
osMemoryPoolDelete(_id);
}
/** Allocate a memory block of type T from a memory pool.
@return address of the allocated memory block or NULL in case of no memory available.
*/

View File

@ -60,6 +60,10 @@ public:
MBED_ASSERT(_id);
}
~Queue() {
osMessageQueueDelete(_id);
}
/** Put a message in a Queue.
@param data message pointer.
@param millisec timeout value or 0 in case of no time-out. (default: 0)