Bug 573477 - [GTK3] ToolItem with DROP_DOWN style leaks native memory

This change adds missing OS.g_list_free() calls in ToolItem with
DROP_DOWN style, after calls to gtk_container_get_children(). This
prevents native memory leaks.

Change-Id: Ibba2eacaab14c93b6c0e03efb0d9ebc728bdb99a
Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/180522
Reviewed-by: Andrey Loskutov <loskutov@gmx.de>
Tested-by: Platform Bot <platform-bot@eclipse.org>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
index f271456..d6dc384 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
@@ -236,6 +236,7 @@
 				long child = GTK3.gtk_bin_get_child(handle);
 				long list = GTK3.gtk_container_get_children(child);
 				arrowHandle = OS.g_list_nth_data(list, 1);
+				OS.g_list_free(list);
 			}
 
 			/*
@@ -879,6 +880,7 @@
 		if ((style & SWT.DROP_DOWN) != 0) {
 			long list = GTK3.gtk_container_get_children(eventHandle);
 			eventHandle = OS.g_list_nth_data(list, 0);
+			OS.g_list_free(list);
 			if (arrowHandle != 0) OS.g_signal_connect_closure (arrowHandle, OS.clicked, display.getClosure (CLICKED), false);
 		}
 
@@ -1473,6 +1475,7 @@
 		if ((style & SWT.DROP_DOWN) != 0) {
 			long list = GTK3.gtk_container_get_children (child);
 			child = OS.g_list_nth_data (list, 0);
+			OS.g_list_free(list);
 			if (arrowHandle != 0) shell.setToolTipText (arrowHandle, newString);
 		}
 		shell.setToolTipText (child != 0 ? child : handle, newString);