About the crash issue: I firstly guess this is the thread issue, but when I check the code, I see that in ccmanager
void CCManager::OnShowCallTip(CodeBlocksEvent& event)
{
event.Skip();
int tooltipMode = Manager::Get()->GetConfigManager(wxT("ccmanager"))->ReadInt(wxT("/tooltip_mode"), 1);
// 0 - disable
// 1 - enable
// 2 - force single page
// 3 - keybound only
if (tooltipMode == 0)
return;
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if (!ed)
return;
cbCodeCompletionPlugin* ccPlugin = GetProviderFor(ed);
if (!ccPlugin)
return;
cbStyledTextCtrl* stc = ed->GetControl();
if (!stc)
return;
int pos = stc->GetCurrentPos();
int argsPos = wxSCI_INVALID_POSITION;
wxString curTip;
if (!m_CallTips.empty())
curTip = m_CurCallTip->tip;
m_CallTips = ccPlugin->GetCallTips(pos, stc->GetStyleAt(pos), ed, argsPos);
...
When call the ccPlugin's GetCallTips() function, I see that there is a check:
std::vector<CodeCompletion::CCCallTip> CodeCompletion::GetCallTips(int pos, int style, cbEditor* ed, int& argsPos)
{
std::vector<CCCallTip> tips;
if (!IsAttached() || !m_InitDone || style == wxSCI_C_WXSMITH || !m_NativeParser.GetParser().Done())
return tips;
int typedCommas = 0;
wxArrayString items;
...
You see, there is a check "!m_NativeParser.GetParser().Done()", This means there is no other thread running on the TokenTree(At least in the active Parser object), so my question is:
do you open several cbp projects in C::B? This is the chance that other Parser objects are running parsing jobs in its thread pool.
Another guess: as Morten has once said the crash line is here
curTip = m_CurCallTip->tip;
My guess is that if m_CurCallTip(an iterator) could point to wrong elements of the m_CallTips(vector)?
EDIT: Maybe, you have two ccPlugins, and with one plugin, you have update the iterator, but this iterator point to the vector updated by another ccPlugin. (This is just a guess)
Since I don't have a chance to reproduce this crash issue, I have all my guesses by reading the CC and CCmanager's source code.