From: Foxe Chen Date: Mon, 20 Jul 2026 17:00:22 +0000 (+0000) Subject: patch 9.2.0816: GTK4: Memory leak in gui_gtk_set_dnd_targets() X-Git-Tag: v9.2.0816^0 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=dd326ec1e8c8a7f734be79abed973871a298697b;p=thirdparty%2Fvim.git patch 9.2.0816: GTK4: Memory leak in gui_gtk_set_dnd_targets() Problem: GTK4: Memory leak in gui_gtk_set_dnd_targets() Solution: Unref formats (Foxe Chen) closes: #20729 Signed-off-by: Foxe Chen Signed-off-by: Christian Brabandt --- diff --git a/src/gui_gtk4.c b/src/gui_gtk4.c index 2bcb31ce9e..fbe4ec5535 100644 --- a/src/gui_gtk4.c +++ b/src/gui_gtk4.c @@ -2582,15 +2582,17 @@ read_data_input_cb( void gui_gtk_set_dnd_targets(void) { - GdkContentFormatsBuilder *builder = gdk_content_formats_builder_new(); + GdkContentFormatsBuilder *builder = gdk_content_formats_builder_new(); + GdkContentFormats *formats; gdk_content_formats_builder_add_gtype(builder, GDK_TYPE_FILE_LIST); gdk_content_formats_builder_add_gtype(builder, G_TYPE_STRING); if (clip_html) gdk_content_formats_builder_add_mime_type(builder, "text/html"); - gtk_drop_target_async_set_formats(gui.drop_target, - gdk_content_formats_builder_free_to_formats(builder)); + formats = gdk_content_formats_builder_free_to_formats(builder); + gtk_drop_target_async_set_formats(gui.drop_target, formats); + gdk_content_formats_unref(formats); } /* diff --git a/src/version.c b/src/version.c index 28726e3739..bb8df567b7 100644 --- a/src/version.c +++ b/src/version.c @@ -759,6 +759,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 816, /**/ 815, /**/