diff options
author | rowanbeentje <rowan@beent.je> | 2010-03-23 21:08:33 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-03-23 21:08:33 +0000 |
commit | c2351f2220ac01cac614de93bad05022d89d7790 (patch) | |
tree | 253cb24dac45eaa8a29924d3fe4017d1cad684ce /Source/TableDocument.m | |
parent | 4755e7c7209582b09f59905540f459accc32acb3 (diff) | |
download | sequelpro-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/TableDocument.m')
-rw-r--r-- | Source/TableDocument.m | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m index ac076c8b..ee793689 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -4006,6 +4006,22 @@ */ - (void)dealloc { + + // Unregister observers + [prefs removeObserver:self forKeyPath:SPDisplayTableViewVerticalGridlines]; + [prefs removeObserver:tableSourceInstance forKeyPath:SPDisplayTableViewVerticalGridlines]; + [prefs removeObserver:tableContentInstance forKeyPath:SPDisplayTableViewVerticalGridlines]; + [prefs removeObserver:customQueryInstance forKeyPath:SPDisplayTableViewVerticalGridlines]; + [prefs removeObserver:tableRelationsInstance forKeyPath:SPDisplayTableViewVerticalGridlines]; + [prefs removeObserver:[SPQueryController sharedQueryController] forKeyPath:SPDisplayTableViewVerticalGridlines]; + [prefs removeObserver:tableSourceInstance forKeyPath:SPUseMonospacedFonts]; + [prefs removeObserver:[SPQueryController sharedQueryController] forKeyPath:SPUseMonospacedFonts]; + [prefs removeObserver:tableContentInstance forKeyPath:SPGlobalResultTableFont]; + [prefs removeObserver:[SPQueryController sharedQueryController] forKeyPath:SPConsoleEnableLogging]; + [prefs removeObserver:self forKeyPath:SPConsoleEnableLogging]; + if (processListController) [prefs removeObserver:processListController forKeyPath:SPDisplayTableViewVerticalGridlines]; + if (serverVariablesController) [prefs removeObserver:serverVariablesController forKeyPath:SPDisplayTableViewVerticalGridlines]; + [_encoding release]; [allDatabases release]; [allSystemDatabases release]; |