aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMTextView.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-03-23 21:08:33 +0000
committerrowanbeentje <rowan@beent.je>2010-03-23 21:08:33 +0000
commitc2351f2220ac01cac614de93bad05022d89d7790 (patch)
tree253cb24dac45eaa8a29924d3fe4017d1cad684ce /Source/CMTextView.m
parent4755e7c7209582b09f59905540f459accc32acb3 (diff)
downloadsequelpro-c2351f2220ac01cac614de93bad05022d89d7790.tar.gz
sequelpro-c2351f2220ac01cac614de93bad05022d89d7790.tar.bz2
sequelpro-c2351f2220ac01cac614de93bad05022d89d7790.zip
- Remove observers for key paths when dealloc'ing objects to fix later crashes when changing those keyvalues (eg changing query editor background colour after closing windows - http://log.sequelpro.com/view/44 )
- Fix a memory leak of a prefs reference in CMTextView
Diffstat (limited to 'Source/CMTextView.m')
-rw-r--r--Source/CMTextView.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index 2a5c43c7..3ea60174 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -3225,7 +3225,24 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
- (void) dealloc
{
+
+ // Remove observers
[[NSNotificationCenter defaultCenter] removeObserver:self];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorFont];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorBackgroundColor];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorHighlightQueryColor];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryHighlightCurrentQuery];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorCommentColor];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorQuoteColor];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorSQLKeywordColor];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorBacktickColor];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorNumericColor];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorVariableColor];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorTextColor];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryEditorTabStopWidth];
+ [prefs removeObserver:self forKeyPath:SPCustomQueryAutoUppercaseKeywords];
+
+ [prefs release];
[lineNumberView release];
if(queryHiliteColor) [queryHiliteColor release];
if(queryEditorBackgroundColor) [queryEditorBackgroundColor release];