Skip to content

Commit 94e2428

Browse files
committed
Fixed bug where reloading a plugin could cause a crash
1 parent 11e6264 commit 94e2428

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

ProcessPreviousLine.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ assemble the full text of the original line.
592592
// Do plugins (stop if one stops trigger evaluation).
593593
// Do only negative sequence number plugins at this point
594594
// Suggested by Fiendish. Added in version 4.97.
595-
for (pit = m_PluginList.begin ();
595+
for (pit = m_PluginList.begin ();
596596
pit != m_PluginList.end () &&
597597
(*pit)->m_iSequence < 0 &&
598598
m_iStopTriggerEvaluation != eStopEvaluatingTriggersInAllPlugins;
@@ -635,12 +635,14 @@ assemble the full text of the original line.
635635
} // end of trigger evaluation not stopped
636636

637637
// do plugins (stop if one stops trigger evaluation, or if it was stopped by the main world triggers)
638-
for ( // pit should now be pointing at plugins with a sequence number >= 0
639-
;
640-
pit != m_PluginList.end () &&
638+
for (pit = m_PluginList.begin ();
639+
pit != m_PluginList.end () &&
641640
m_iStopTriggerEvaluation != eStopEvaluatingTriggersInAllPlugins;
642641
++pit)
643642
{
643+
// skip past negative sequence numbers
644+
if ((*pit)->m_iSequence > 0)
645+
continue;
644646
m_CurrentPlugin = *pit;
645647
// allow trigger evaluation for the moment (ie. the next plugin)
646648
m_iStopTriggerEvaluation = eKeepEvaluatingTriggers;

evaluate.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ CAliasList AliasList;
7676
// Do plugins (stop if one stops trigger evaluation).
7777
// Do only negative sequence number plugins at this point
7878
// Suggested by Fiendish. Added in version 4.97.
79-
for (pit = m_PluginList.begin ();
79+
for (pit = m_PluginList.begin ();
8080
pit != m_PluginList.end () &&
8181
(*pit)->m_iSequence < 0;
8282
++pit)
@@ -105,11 +105,13 @@ CAliasList AliasList;
105105
return true;
106106

107107
// do plugins (stop if one stops alias evaluation)
108-
for ( // pit should now be pointing at plugins with a sequence number >= 0
109-
;
110-
pit != m_PluginList.end ();
108+
for (pit = m_PluginList.begin ();
109+
pit != m_PluginList.end ();
111110
++pit)
112111
{
112+
// skip past negative sequence numbers
113+
if ((*pit)->m_iSequence > 0)
114+
continue;
113115
m_CurrentPlugin = *pit;
114116
if (m_CurrentPlugin->m_bEnabled)
115117
if (ProcessOneAliasSequence (input,

0 commit comments

Comments
 (0)