apprt/gtk-ng: clear memory properly

pull/8005/head
Mitchell Hashimoto 2025-07-21 07:04:24 -07:00
parent cd82a610c3
commit ef686d62aa
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 8 additions and 3 deletions

View File

@ -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,