[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crash in GUI / ProjectCenter

From: Riccardo Mottola
Subject: Re: crash in GUI / ProjectCenter
Date: Fri, 13 Jan 2023 01:46:58 +0100
User-agent: GNUMail (Version 1.4.0)

Hi Wolfgang!

I had a nice hacking session with Fred this evening and ... fresh mind, new fixes.!

I found the memory issue - there was an issue with subview! ProjectCenter had some complex code where a subview was released twice. I was able to refactor things and keep vars more localy and fix that. Thanks for the "hint".

On 2023-01-11 12:46:36 +0100 Wolfgang Lux <> wrote:

I'm not so sure about my suggested fix/hack. Certainly, it does the job and I don't see a reason why a window should be updating its cursor rectangles after the window has been closed (at least if it is supposed to be released at that point). Another option would likely be to close the backend connection more swiftly when a window is closed. For instance, in -[NSWindow orderWindow:relativeTo:] we might change the last condition from
  else if ([self isOneShot])
else if ([self isOneShot] || (_f.has_closed && _f.is_released_when_closed)) to close the backend window immediately rather than waiting for this to happen from an autorelease pool.

One thing that is worrying is that you saw a crash even when resetting the delegates in the dealloc method. The stacktrace looks like -[NSWindow resetCursorRects] gets called for a window with a corrupted view hierarchy where a child window seems to have been deallocated while it is still present in the hierarchy. This is something that should never happen (at least not where sendEvent: can possibly be called). So maybe there is some other memory management bug at play here.

now the delegate problem remains "only". I am able to work-around this now, with this patch:

+++ b/Framework/PCProjectWindow.m
@@ -260,6 +260,8 @@
 - (void)dealloc
   [[NSNotificationCenter defaultCenter] removeObserver:self];
+  [h_split setDelegate:nil];
+  [v_split setDelegate:nil];
   [projectWindow close];

   [super dealloc];

unsetting the delegate and fixing the view release issue.. solves the crash, at least for ProjectCenter.
Where else where you experiencing the issue?

We need to think if this delegate-to-nil fix is proper of GUI orthe GUI code is safe and the work-around in ProjectCenter is fine. However, if you noticed things elsewhere, we might need to check.

What's your point? Fred?


Sent with pride with GNUMail running on GNUstep on Debian GNU/Linux on a SunFire with Niagara SPARC64.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]