Skip to content

clipboard-rdp: Also ensure that the mime type tables are freed

Quoting the commit here:

Commit 982b4db3cc06d86138cb49322d55ebc990671410 fixes a memory leak,
that can happen, if there is still a list of pending mime type tables,
when the session ends.
While the commit ensures that the update context is freed, it does not
clear the list of pending mime type tables itself.

Do this now in this commit. Use however here g_idle_add_full(), instead
of g_idle_add(), as that function allows the caller to pass a destroy
function, which is called, when the GSource is removed.
When the source function is called, steal the mime type tables, to
ensure that the pointer is NULL to avoid a double free.

Fixes 982b4db3cc06d86138cb49322d55ebc990671410

Merge request reports