jmuehlner commented on code in PR #455:
URL: https://github.com/apache/guacamole-server/pull/455#discussion_r1308050939
##########
src/common/list.c:
##########
@@ -34,8 +34,32 @@ guac_common_list* guac_common_list_alloc() {
}
-void guac_common_list_free(guac_common_list* list) {
+void guac_common_list_free(
+ guac_common_list* list,
+ guac_common_list_element_free_handler* free_element_handler) {
+
+ pthread_mutex_lock(&(list->_lock));
+
+ /* Free every element of the list */
+ guac_common_list_element* element = list->head;
+ while(element != NULL) {
+
+ guac_common_list_element* next = element->next;
+
+ if (free_element_handler != NULL)
+ free_element_handler(element->data);
+
+ free(element);
+ element = next;
+ }
+
+ /* Destroy the mutex controlling access to the list */
+ pthread_mutex_unlock(&(list->_lock));
Review Comment:
Ok, will remove.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]