Release NS objects (bug#79023)

* src/nsterm.m (ns_free_frame_resources): Release the NSView.
([EmacsView dealloc]): Release the EmacsLayer and menu.
([EmacsWindow dealloc]): Fix the toolbar release.

Co-authored-by: Rudolf Adamkovič <rudolf@adamkovic.org>
This commit is contained in:
Przemysław Alexander Kamiński 2025-10-17 11:24:31 +01:00 committed by Alan Third
parent ba8752cae9
commit 7de5a6d1f7

View file

@ -1637,6 +1637,7 @@ Hide the window (X11 semantics)
[[view window] close];
[view removeFromSuperview];
[view release];
xfree (f->output_data.ns);
f->output_data.ns = NULL;
@ -6844,6 +6845,14 @@ - (void)dealloc
if (fs_state == FULLSCREEN_BOTH)
[nonfs_window release];
#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
/* Release layer and menu */
EmacsLayer *layer = (EmacsLayer *)[self layer];
[layer release];
#endif
[[self menu] release];
[super dealloc];
}
@ -9599,8 +9608,9 @@ - (void)dealloc
NSTRACE ("[EmacsWindow dealloc]");
/* We need to release the toolbar ourselves. */
[self setToolbar: nil];
[[self toolbar] release];
[self setToolbar: nil];
/* Also the last button press event . */
if (last_drag_event)