User forums > Using Code::Blocks
bug report: C::B crash when I remove the target from a cbp
AndrewCot:
I can also confirm no crash.
I spotted that after I deleted the C::B SDK target as the clangd_client kept parsing the SDK files (after pressing the OK button and waiting a few seconds). I suspect the files were queued to be processed and the queue was not reset/updated/fixed due to the SDK target being deleted. I think this could be logged as a bug, but as it does not cause any issues that I could see the bug could wait until some time in the future to fix when time permits. Does this sound okay? (Raise a bug and fix it when time permits.)
Pecan:
--- Quote from: AndrewCot on October 18, 2022, 09:50:35 am ---I can also confirm no crash.
I spotted that after I deleted the C::B SDK target as the clangd_client kept parsing the SDK files (after pressing the OK button and waiting a few seconds). I suspect the files were queued to be processed and the queue was not reset/updated/fixed due to the SDK target being deleted. I think this could be logged as a bug, but as it does not cause any issues that I could see the bug could wait until some time in the future to fix when time permits. Does this sound okay? (Raise a bug and fix it when time permits.)
--- End quote ---
I'll log this into the clangd_client ticket systems.
Thanks guys.
Pecan:
--- Quote from: AndrewCot on October 18, 2022, 09:50:35 am ---I can also confirm no crash.
I spotted that after I deleted the C::B SDK target as the clangd_client kept parsing the SDK files (after pressing the OK button and waiting a few seconds). I suspect the files were queued to be processed and the queue was not reset/updated/fixed due to the SDK target being deleted. I think this could be logged as a bug, but as it does not cause any issues that I could see the bug could wait until some time in the future to fix when time permits. Does this sound okay? (Raise a bug and fix it when time permits.)
--- End quote ---
@ Andrew
What was the message you on which you had to click ok.
It might help me to find exactly where the problem lies.
Edit: Never mind, I think you meant the target delete confirmation.
This is a rough one. The background queue can validly contain files that do not belong to a project or target.
And, the target is deleted before the cbEVT_BUILDTARGET_REMOVED event is issued, thus wiping out any info for comparison of background queue to target files.
Pecan:
Re: Clangd_client keeps parsing after target deletion.
There already is code in the parsers waiting queue to check that the file about to be parsed belongs to a project.
--- Code: --- ProjectFile* pf = m_Project->GetFileByFilename(list->GetString(i));
if (!pf)
break;
--- End code ---
So those sdk target files must have other targets referencing them. Or, there's an error in CB.
Since both old CodeCompletion and Clangd_client work at the project level, I'm pretty sure the code is correct.
But I can test like:
--- Code: ---pseudo code:
If file belongs to a project, and ProjectFile-GetTargets() returns zero targets, Do Not parse this file.
--- End code ---
But I think that this is useless effort. I betcha it'll return a target every time. Since most projects have at least a release and debug target, one of them will always report that it owns the file. Especially in that CB will not let you delete a target if it's a single target project.
But I'll test deleting the sdk target anyway.
Navigation
[0] Message Index
[*] Previous page
Go to full version