Bug 496266

Summary: Editor text view leaks out
Product: [Applications] kdevelop Reporter: Game-Editor2 <gameeditor.ale>
Component: UI: generalAssignee: kdevelop-bugs-null
Status: REPORTED ---    
Severity: major    
Priority: NOR    
Version First Reported In: 5.6.2   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: The bug in action

Description Game-Editor2 2024-11-14 14:14:31 UTC
Created attachment 175813 [details]
The bug in action

SUMMARY
I've been happily using KDevelop for large projects for quite some time. For the most part (even though I am running the Windows version) it seems pretty stable. Recently, I started noticing a critical issue very frequently.
The source view widget (the text editor) leaks code.

STEPS TO REPRODUCE
1. Work on a big header-guarded source code (2k loc or more)
2. Use code folding, clipboard io, etc...
3. Something provokes UB. At some point, the cached code will become erroneous.

OBSERVED RESULT
At first, the compilation will fail, because the code will break only logically (in memory).
After KDevelop is restarted, you will see that some portion of the code at the bottom is randomly repeated resulting in the same error.

SOFTWARE/OS VERSIONS
Windows: Windows 11

ADDITIONAL INFORMATION
This is a bug that seems dangerous or in the slightest, it disturbs the workflow.
Comment 1 Game-Editor2 2024-11-14 14:16:51 UTC
guarded header file or source file*