summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-01-20 21:32:15 (GMT)
committerSwift Review <review@swift.im>2015-02-05 16:47:43 (GMT)
commitab1fff7fb56de38d9df3c6fba9c4efec9a3042bd (patch)
tree1169779c90d82c471abefc257f33e97a8799711d /Swift/Controllers/HighlightManager.h
parentccaa8342069eaa07d6cb3a4273c83f44883472fe (diff)
downloadswift-ab1fff7fb56de38d9df3c6fba9c4efec9a3042bd.zip
swift-ab1fff7fb56de38d9df3c6fba9c4efec9a3042bd.tar.bz2
Fix ASAN reported use-after-free error
The class connects to SettingsProvider::onSettingChanged in its c-tor but never disconnects from the signal. When an instance is deleted and the signal is called afterwards it will call the method which will try to access class members which have already been deleted. Test-Information: Tested on OS X 10.9.5. ASAN reported it sometimes on exit. Have not been able to reproduc it anymore with this fix. Change-Id: I7f1d815dca87f84a4ae93a5455307e261a1ee329
Diffstat (limited to 'Swift/Controllers/HighlightManager.h')
-rw-r--r--Swift/Controllers/HighlightManager.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Swift/Controllers/HighlightManager.h b/Swift/Controllers/HighlightManager.h
index d37643d..c55990b 100644
--- a/Swift/Controllers/HighlightManager.h
+++ b/Swift/Controllers/HighlightManager.h
@@ -67,10 +67,12 @@ namespace Swift {
std::string rulesToString() const;
static std::vector<HighlightRule> getDefaultRules();
+ private:
SettingsProvider* settings_;
bool storingSettings_;
boost::shared_ptr<HighlightManager::HighlightRulesList> rules_;
+ boost::bsignals::scoped_connection handleSettingChangedConnection_;
};
typedef boost::shared_ptr<const HighlightManager::HighlightRulesList> HighlightRulesListPtr;