primaryClipboardData
Object[] primaryClipboardData
(package private) Clipboard(package private) Clipboard(package private) Callback(package private) Object[](package private) Transfer[](package private) long(package private) Display(package private) Callback(package private) static String(package private) Object[](package private) Transfer[](package private) static ClipboardProxy_getInstance(Display display) (package private) void(package private) longclearFunc(long clipboard,
long user_data_or_owner) (package private) voiddispose()private voidsetData(Clipboard, Object[], Transfer[], int)) means the
GtkClipboard (in C side) has function pointers saved to the getFunc +
clearFunc callbacks.(package private) longgetFunc(long clipboard,
long selection_data,
long info,
long user_data_or_owner) (package private) voidgtk_gdk_clipboard_clear(long clipboard) (package private) booleansetData(Clipboard, Object[], Transfer[], int)) means the
GtkClipboard (in C side) has function pointers saved to the getFunc +
clearFunc callbacks.
Therefore, when we dispose ClipboardProxy we cannot dispose the
callbacks until we know that GtkClipboard doesn't have a pointer to these
callbacks. GtkClipboard clears these pointers in clipboard_unset
(https://gitlab.gnome.org/GNOME/gtk/-/blob/716458e86a222f43e64f7a4feda37749f3469ee4/gtk/gtkclipboard.c#L755)
and notifies us that the pointers are no longer stored by calling clearFunc
(https://gitlab.gnome.org/GNOME/gtk/-/blob/716458e86a222f43e64f7a4feda37749f3469ee4/gtk/gtkclipboard.c#L782)
Therefore, after disposing ClipboardProxy we need to defer disposing the
callbacks until clearFunc has been called.
We know if we have been called sufficiently (for both clipboards that could
have a handle stored) when both clipboards no longer have data stored.
If we don't defer the disposal it causes SIGSEGV or other undefined behavior.
Fix for https://github.com/eclipse-platform/eclipse.platform.swt/issues/2675