diff --git a/ChangeLog b/ChangeLog index 38bb7d1f3..047d98f17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-07-11 Fred Kiefer + + * Source/NSDocumentController.m (-dealloc), + * Source/NSWindow.m (-dealloc), + * Source/NSLayoutManager.m (-dealloc): Unbind key bindings. + 2011-07-11 Eric Wasylishen * Source/NSColorPanel.m (-_magnify:): Preliminary implementation diff --git a/Source/NSDocumentController.m b/Source/NSDocumentController.m index 2e4a103a2..fd5935671 100644 --- a/Source/NSDocumentController.m +++ b/Source/NSDocumentController.m @@ -47,6 +47,7 @@ #import "AppKit/NSWorkspace.h" #import "NSDocumentFrameworkPrivate.h" #import "GSGuiPrivate.h" +#import "GSBindingHelpers.h" static NSString *NSTypesKey = @"NSTypes"; static NSString *NSNameKey = @"NSName"; @@ -327,6 +328,9 @@ TypeInfoForHumanReadableName (NSArray *types, NSString *typeName) - (void) dealloc { + // Remove all key value bindings for this object. + [GSKeyValueBinding unbindAllForObject: self]; + [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver: self]; RELEASE (_documents); RELEASE (_recent_documents); diff --git a/Source/NSLayoutManager.m b/Source/NSLayoutManager.m index 44e289030..b2e1f99b7 100644 --- a/Source/NSLayoutManager.m +++ b/Source/NSLayoutManager.m @@ -122,6 +122,7 @@ first. Remaining cases, highest priority first: #import "AppKit/DPSOperators.h" #import "GNUstepGUI/GSLayoutManager_internal.h" +#import "GSBindingHelpers.h" @interface NSLayoutManager (spelling) @@ -2180,6 +2181,9 @@ static void GSDrawPatternLine(NSPoint start, NSPoint end, NSInteger pattern, CGF -(void) dealloc { + // Remove all key value bindings for this object. + [GSKeyValueBinding unbindAllForObject: self]; + DESTROY(_typingAttributes); DESTROY(_temporaryAttributes); [super dealloc]; diff --git a/Source/NSWindow.m b/Source/NSWindow.m index dda47810b..5f2fe04b5 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -76,18 +76,18 @@ #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "AppKit/NSWindowController.h" -#import "GSBindingHelpers.h" #import "AppKit/PSOperators.h" + #import "GNUstepGUI/GSTheme.h" #import "GNUstepGUI/GSTrackingRect.h" #import "GNUstepGUI/GSDisplayServer.h" +#import "GNUstepGUI/GSWindowDecorationView.h" +#import "GSBindingHelpers.h" #import "GSGuiPrivate.h" #import "GSToolTips.h" #import "GSIconManager.h" #import "NSToolbarFrameworkPrivate.h" -#import - #define GSI_ARRAY_TYPES 0 #define GSI_ARRAY_TYPE NSWindow * #define GSI_ARRAY_NO_RELEASE 1 @@ -754,6 +754,9 @@ many times. - (void) dealloc { + // Remove all key value bindings for this object. + [GSKeyValueBinding unbindAllForObject: self]; + DESTROY(_toolbar); [nc removeObserver: self]; [[self class] _removeAutodisplayedWindow: self];