Recent Posts

Pages: 1 2 3 4 5 [6] 7 8 9 10
51
Development / Re: Use of '_T("...")' with 'CB'
« Last post by LETARTARE on September 03, 2026, 05:11:28 pm »
@gd_on
Could you tell me the line or the lines involved ?

Because under 'Leap-15.6, gcc-15.2' I can't find any error in 'parserthread.cpp' when compiling.
52
Development / Re: Use of '_T("...")' with 'CB'
« Last post by Miguel Gimenez on September 03, 2026, 05:10:05 pm »
Are these errors inside calls to TRACE()?
53
Patch applied in r13992, thank you.

NOTE: The patch did not apply cleanly on current trunk, some hunks were rejected (probably because of changes made by r13991). I had to apply it manually.
54
Development / Re: Use of '_T("...")' with 'CB'
« Last post by LETARTARE on September 03, 2026, 04:55:35 pm »
I look immediately...
55
Development / Re: Use of '_T("...")' with 'CB'
« Last post by gd_on on September 03, 2026, 04:48:15 pm »
Problem with svn 13991.
Apparently, at least in parserthread.cpp, some strings have been changed inside the ?: operator. This does not work.
56
Development / Re: Use of '_T("...")' with 'CB'
« Last post by LETARTARE on September 03, 2026, 12:15:36 pm »
For those who are interested in research:

Here is the regular expression to use for '_T(' in 'CB'
Research :
Code
 '_T\(("(\\"|[^"])*")\)'
Replace :
Code
'\1'
Note : the ' must not be written
57
Development / Re: Use of '_T("...")' with 'CB'
« Last post by LETARTARE on September 03, 2026, 11:38:28 am »
I just provided three fixes (1636, 1637, 1638) to replace
 
Code
'_T("...")' or  'wxT("...")' by '"..."'
for 'autosave', 'classwizard', codecompletion' plugins
58
Hello Code::Blocks team,

I've encountered a severe issue where Code::Blocks 25.03 crashes immediately on startup on macOS 15 (Apple Silicon running via Rosetta 2). The crash throws an `EXC_BAD_ACCESS` (null pointer dereference) in `libcodecompletion.dylib`.

Root Cause Analysis:
The crash is caused by an initialization order / timing issue during startup on macOS.
When `CodeCompletion::OnAttach()` calls `m_ParseManager.CreateClassBrowser()`, the application subsystems (specifically `ProjectManager` and its Notebook UI) are not fully initialized yet.

1. `ParseManager::CreateClassBrowser()` attempts to get the notebook from `ProjectManager`, but it may not be ready.
2. Later, it calls `m_ClassBrowser->SetParser(m_Parser)`.
3. Inside `ClassBrowser::SetParser()`, it unconditionally calls `UpdateClassBrowserView()`, which attempts to access `Manager::Get()->GetProjectManager()` and crashes.
4. Additionally, the `ClassBrowser` constructor tries to fetch the ImageList without checking if `m_ParseManager` is valid.

Proposed Patch:
I've compiled a patched version locally and it completely resolves the crash, allowing CodeCompletion to work perfectly on macOS. We just need to add defensive null-pointer checks in `classbrowser.cpp` and `parsemanager.cpp`.

Here is the diff against the SVN trunk:

Code
--- src/plugins/codecompletion/classbrowser.cpp
+++ src/plugins/codecompletion/classbrowser.cpp
@@ -176,8 +176,15 @@
     m_CCTreeCtrlBottom = XRCCTRL(*this, "treeMembers", CCTreeCtrl);
 
     // Registration of images
-    m_CCTreeCtrl->SetImageList(m_ParseManager->GetImageList(16));
-    m_CCTreeCtrlBottom->SetImageList(m_ParseManager->GetImageList(16));
+    if (m_ParseManager)
+    {
+        wxImageList* imgList = m_ParseManager->GetImageList(16);
+        if (imgList)
+        {
+            m_CCTreeCtrl->SetImageList(imgList);
+            m_CCTreeCtrlBottom->SetImageList(imgList);
+        }
+    }
 
     ConfigManager* cfg = Manager::Get()->GetConfigManager("code_completion");
     const int filter = cfg->ReadInt("/browser_display_filter", bdfFile);
@@ -239,12 +246,19 @@
     {
         const int sel = XRCCTRL(*this, "cmbView", wxChoice)->GetSelection();
         BrowserDisplayFilter filter = static_cast<BrowserDisplayFilter>(sel);
-        if (!m_ParseManager->IsParserPerWorkspace() && filter == bdfWorkspace)
+        if (m_ParseManager && !m_ParseManager->IsParserPerWorkspace() && filter == bdfWorkspace)
             filter = bdfProject;
 
         m_Parser->ClassBrowserOptions().displayFilter = filter;
         m_Parser->WriteOptions(/*classbrowserOnly=*/true);
-        UpdateClassBrowserView();
+
+        // Guard: Only update the class browser view if the application
+        // subsystems (ProjectManager, EditorManager) are fully initialized.
+        if (Manager::Get()->GetProjectManager() &&
+            Manager::Get()->GetEditorManager())
+        {
+            UpdateClassBrowserView();
+        }
     }
     else
         CCLogger::Get()->DebugLog("SetParser: No parser available.");

--- src/plugins/codecompletion/parsemanager.cpp
+++ src/plugins/codecompletion/parsemanager.cpp
@@ -1043,9 +1043,16 @@
     }
     else
     {
+        // Guard against ProjectManager not being ready yet (macOS startup race)
+        ProjectManager* prjMgr = Manager::Get()->GetProjectManager();
+        if (!prjMgr || !prjMgr->GetUI().GetNotebook())
+        {
+            CCLogger::Get()->DebugLog("CreateClassBrowser: ProjectManager not ready, deferring.");
+            return;
+        }
         // make this a tab in projectmanager notebook
-        m_ClassBrowser = new ClassBrowser(Manager::Get()->GetProjectManager()->GetUI().GetNotebook(), this);
-        Manager::Get()->GetProjectManager()->GetUI().GetNotebook()->AddPage(m_ClassBrowser, _("Symbols"));
+        m_ClassBrowser = new ClassBrowser(prjMgr->GetUI().GetNotebook(), this);
+        prjMgr->GetUI().GetNotebook()->AddPage(m_ClassBrowser, _("Symbols"));
         m_ClassBrowser->UpdateSash();
     }
 
@@ -1053,7 +1060,8 @@
     // TODO (Morten): ? what's bug? I test it, it's works well now.
-    m_ClassBrowser->SetParser(m_Parser); // Also updates class browser
+    if (m_Parser)
+        m_ClassBrowser->SetParser(m_Parser); // Also updates class browser
 
     TRACE(_T("ParseManager::CreateClassBrowser: Leave"));
 }

Hope this helps improve macOS stability. Let me know if you need any more information!
59
Spam reported to moderator.
60
Nightly builds / Re: The 26 August 2026 build (13961) is out.
« Last post by cacb on September 02, 2026, 09:21:30 am »
Thank you for all the efforts in maintaining C::B and producing Nightly Builds, I really enjoy it. I use C::B under Windows 10 and Kubuntu 24.04 currently.

The improved support for dark mode is appreciated, I find it more important than before. I noticed a small issue with hyperlinks to workspaces on the front page. Dark blue hyperlinks does not work well with near black background in dark mode. This can be fixed manually by any user in Environment -> Colours but it would be nice if it was handled more seamlessly.

On dark mode in the code editor, I realize that the C::B scintilla editor is old and does not support it directly. But a work around might be to include a built in custom editor dark theme that users can select when using C::B in dark mode. This would make it easier to switch between light and dark modes.
Pages: 1 2 3 4 5 [6] 7 8 9 10