[Top][All Lists]

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

Re: Testers wanted for MPDCon and Zipper

From: Fred Kiefer
Subject: Re: Testers wanted for MPDCon and Zipper
Date: Wed, 22 Feb 2012 17:55:44 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1

On 22.02.2012 12:40, Wolfgang Lux wrote:
Riccardo Mottola wrote:

I am not able to reproduce this behaviour here (OpenSuse 12.1, gcc 4.6,
64bit). I get plenty of horrible compiler warnings from Zipper (current CVS), 
which really should be fixed before looking deeper into any issue with that 
Could you please describe in detail all the steps required to reproduce the 

strange that you cannot reproduce it. I can. I think it might be a problem in 
Zipper since it got NIB created panels. I don't like at a first glance how the 
panel gets closed.

when ok and Cancel get invoked, they call stopModal, then endModalSession is 
called automatically. Everything is fine.
But how does the Panel close? the end of the modal session should close it, 

I don't like that windowWillClose calls a release to self either. Removing 
that, I solve the crash. I commit that for the time being.

You may like it or not, but this part was correct. What you did then was 
replacing poor code (using a modal panel where a non-modal panel should be 
used) by even worse code (you now also have a space leak). Since the problem is 
the close button of the panel you simply should have disabled the close box in 
the panel for now.

I had a look at the code and think that the actual problem is this method:

- (void)showPreferencesPanel
        NSModalSession modalSession = [NSApp beginModalSessionForWindow:_panel];
        [NSApp runModalForWindow:_panel];
        // control flow returns to the panel ... until 'ok' or 'cancel' is 
        [NSApp endModalSession:modalSession];
        [_panel close];

It should just read:

- (void)showPreferencesPanel
        [NSApp runModalForWindow:_panel];
        [_panel close];

And if you change it to that, without any further change in the code, the crash is gone. Who ever wrote this code got confused between runModalSession: and runModalForWindow: and as usual it is best to rely on the framework to implement stuff. As for the concerns about the memory leak, it is even worse. The code was already leaking the panel as the controller is missing a dealloc method. I would suggest to clean up the application first and then come back with the remaining issues.

reply via email to

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