From ef686d62aa94e41612937e14c1bba71a87809974 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 21 Jul 2025 07:04:24 -0700 Subject: [PATCH] apprt/gtk-ng: clear memory properly --- src/apprt/gtk-ng/class/surface.zig | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/apprt/gtk-ng/class/surface.zig b/src/apprt/gtk-ng/class/surface.zig index 211deebfb..b719cb870 100644 --- a/src/apprt/gtk-ng/class/surface.zig +++ b/src/apprt/gtk-ng/class/surface.zig @@ -863,9 +863,14 @@ pub const Surface = extern struct { priv.core_surface = null; } - var @"null": gobject.Value = undefined; - if (priv.pwd != null) properties.pwd.set(self, &@"null"); - if (priv.title != null) properties.pwd.set(self, &@"null"); + if (priv.pwd) |v| { + glib.free(@constCast(@ptrCast(v))); + priv.pwd = null; + } + if (priv.title) |v| { + glib.free(@constCast(@ptrCast(v))); + priv.title = null; + } gobject.Object.virtual_methods.finalize.call( Class.parent,