Comments (5)
What exactly make you think that the thread of Virtual TreeView causes the crash?
from virtual-treeview.
I attach demo code (two projects: exe and dll):
VST_Test.zip
On my computer have no errors, but when I run it on Windows 2012/2016/2019 Server, click button and close window (by shortcut, by mouse click - no matter) in 1 on 10 times crash (but sometime can be 10 times without error, and next every 3 run and close ends with crash).
here attach system logs:
VSTerrors.zip
from virtual-treeview.
PS - When I made changes in dispose method, then works good:
class procedure TWorkerThread.Dispose(CanBlock: Boolean);
var
LRef: TThread;
begin
WorkerThread.FreeOnTerminate := False; // << NEVR USE FREE ON TERMINATE
//WorkerThread.FreeOnTerminate := not CanBlock; // << -- " --
WorkerThread.Terminate();
SetEvent(WorkerThread.FWorkEvent);
LRef := WorkerThread;
WorkerThread.WaitFor; // << ADD WAITING FOR TERMINATE
WorkerThread := nil; //Will be freed usinf TThread.FreeOnTerminate
//if CanBlock then << DISABLE THIS LINE - OBJECT MUST BE ALWAYS FREE
LRef.Free;
end;
from virtual-treeview.
I didn't get a single crash in 30 tries with your demo project.
Can you please check if the following change makes any difference in your case: In TBaseVirtualTree.Destroy()
change the call to TWorkerThread.ReleaseThreadReference
to:
TWorkerThread.ReleaseThreadReference(IsLibrary);
from virtual-treeview.
I try my demo on my own system, and it's crash after about 1 on 60-80 trials (very infrequently, but possible). I think, it depends on cpu cores load.
I made the changes as suggested (and I rolled back my own previous changes) and looks all right - no more crashes.
from virtual-treeview.
Related Issues (20)
- DefaultNodeHeight has no effect since 8.0.2 HOT 2
- Reordered Grid of columns htrows exception when moving left with the keyboard HOT 2
- Fixed columns are broken in V7.6.6 and V8.0.2 HOT 3
- As of the September 22, 2023 release, the C++Builder version is not compatible with the previous version HOT 2
- Method `TVirtualTreeColumn.GetCaptionWidth` handles owner-drawn caption badly HOT 5
- Incompatible error when calling VTAccessibilityFactory.GetAccessibilityFactory.CreateIAccessible(Self); HOT 4
- VirtualTreeView DefaultNodeHeight dont work HOT 1
- Access violation on changing option of multiselected column header HOT 1
- Distorted shape when dragging the columns HOT 1
- double-click clears selected checkboxes HOT 1
- Cannot compile 8.0.3 package in Delphi XE3 HOT 1
- Vertical Scrollbar Cannot Show if the Tree Nodes are Hidden Initially HOT 6
- Let toAutoTristateTracking to ignore invisible nodes HOT 2
- AutoScroll does not respect AutoScrollDelay property HOT 6
- Height overflow when adding large number of nodes HOT 5
- AutoScale wrongly assumes that node height only depends on font size HOT 3
- A loooooooooooong bug in IterateSubtree HOT 4
- DefaultNodeHeight ignores set value and recalculates to default HOT 1
- Wrong canvas brush color in OnAfterCellPaint event HOT 6
- GetNodeData returns invalid data when (Node = Pointer(Self)) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from virtual-treeview.