[dasher] Fix segfault in CControlManager::updateActions
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher] Fix segfault in CControlManager::updateActions
- Date: Tue, 12 Oct 2010 11:34:42 +0000 (UTC)
commit 0f3564664a5a17fc7cf9341d09fc0d3493181e3b
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date: Fri Oct 8 10:12:49 2010 +0100
Fix segfault in CControlManager::updateActions
Src/DasherCore/ControlManager.cpp | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/Src/DasherCore/ControlManager.cpp b/Src/DasherCore/ControlManager.cpp
index 1023052..83159dd 100644
--- a/Src/DasherCore/ControlManager.cpp
+++ b/Src/DasherCore/ControlManager.cpp
@@ -459,33 +459,33 @@ void CControlManager::updateActions() {
// or a static filter but a 'stop' action is easier than using speak->all / copy->all then pause)
if (m_pInterface->hasStopTriggers() && m_pInterface->GetBoolParameter(BP_CONTROL_MODE_HAS_HALT))
vRootSuccessors.push_back(m_perId[CTL_STOP]);
- if (*it == m_perId[CTL_STOP]) it++;
+ if (it!=vOldRootSuccessors.end() && *it == m_perId[CTL_STOP]) it++;
//filter is pauseable, and either 'stop' would do something (so pause is different),
// or we're told to have a stop node but it would be indistinguishable from pause (=>have pause)
CInputFilter *pInput(static_cast<CInputFilter *>(m_pInterface->GetModuleByName(m_pInterface->GetStringParameter(SP_INPUT_FILTER))));
if (pInput->supportsPause() && (m_pInterface->hasStopTriggers() || m_pInterface->GetBoolParameter(BP_CONTROL_MODE_HAS_HALT)))
vRootSuccessors.push_back(m_perId[CTL_PAUSE]);
- if (*it == m_perId[CTL_PAUSE]) it++;
+ if (it!=vOldRootSuccessors.end() && *it == m_perId[CTL_PAUSE]) it++;
if (m_pInterface->GetBoolParameter(BP_CONTROL_MODE_HAS_SPEECH) && m_pInterface->SupportsSpeech()) {
if (!m_pSpeech) m_pSpeech = new SpeechHeader(m_pInterface, GetRootTemplate());
vRootSuccessors.push_back(m_pSpeech);
}
- if (*it == m_pSpeech) it++;
+ if (it!=vOldRootSuccessors.end() && *it == m_pSpeech) it++;
if (m_pInterface->GetBoolParameter(BP_CONTROL_MODE_HAS_COPY) && m_pInterface->SupportsClipboard()) {
if (!m_pCopy) m_pCopy = new CopyHeader(m_pInterface, GetRootTemplate());
vRootSuccessors.push_back(m_pCopy);
}
- if (*it == m_pCopy) it++;
+ if (it!=vOldRootSuccessors.end() && *it == m_pCopy) it++;
if (m_pInterface->GetBoolParameter(BP_CONTROL_MODE_HAS_EDIT)) {
vRootSuccessors.push_back(m_perId[CTL_MOVE]);
vRootSuccessors.push_back(m_perId[CTL_DELETE]);
}
- if (*it == m_perId[CTL_MOVE]) it++;
- if (*it == m_perId[CTL_DELETE]) it++;
+ if (it!=vOldRootSuccessors.end() && *it == m_perId[CTL_MOVE]) it++;
+ if (it!=vOldRootSuccessors.end() && *it == m_perId[CTL_DELETE]) it++;
//copy anything else (custom) that might have been added...
while (it != vOldRootSuccessors.end()) vRootSuccessors.push_back(*it++);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]