You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Okay, this might boil down to personal preference but the use of singletons in this class bothers me somewhat. When the preference window is closed, the class and all those views are still sitting around in memory. This is especially bad when you have elaborate preferences, which in my case use a fair amount of memory.
If the singleton needs to stay, then perhaps there could be added a destruct method that will kill the singleton as well as its subviews. Not sure what the best way is to go about this. Ideas?
The text was updated successfully, but these errors were encountered:
Hi,
I had a similar issue. My app was experiencing random crashes after users opens the preferences window a few times. I suspect the singleton design is causing it.
So, I am not using the class as a singleton anymore. I alloc and initialize it for every uses. Like this:
-(IBAction)showPreferences:(id)sender {
//activate app
[NSAppactivateIgnoringOtherApps:YES];
//instantiate preferences window controllerif (_preferencesWindowController) {
[_preferencesWindowController release];
_preferencesWindowController = nil;
}
//init from nib but the real initialization happens in the//PreferencesWindowController setupToolbar method
_preferencesWindowController = [[PreferencesWindowController alloc] initWithWindowNibName:@"Preferences"];
[_preferencesWindowController showWindow:self];
//[[PreferencesWindowController sharedPrefsWindowController] showWindow:self];
}
Okay, this might boil down to personal preference but the use of singletons in this class bothers me somewhat. When the preference window is closed, the class and all those views are still sitting around in memory. This is especially bad when you have elaborate preferences, which in my case use a fair amount of memory.
If the singleton needs to stay, then perhaps there could be added a destruct method that will kill the singleton as well as its subviews. Not sure what the best way is to go about this. Ideas?
The text was updated successfully, but these errors were encountered: