Jump to content
Mark Williams

Delphi 5 - VirtualTreeView

Recommended Posts

I have a very old project written in Delphi 5. 

 

Upgrade to RAD Studio not really possible at the moment due to work commitments.

 

The project uses VirtualTreeView version 4.0.15 and includes various TVirtualStringTrees on various forms including the main form.

 

I have made numerous small changes to the project in the last few weeks. I am now randomly getting errors when closing forms (including those which do not include TVirtualStringTree. The error arises from the  freeing if tree nodes. No clue in the error report as to which treeview. I have tried to replicate the error by repeating the same steps to no avail. It is quite random.

 

When the error arises the app has to be restarted.

 

I assume the error is caused by some change I have made somewhere along the line, but I can't think what.

 

I am trying to find a later version of VirtualTreeView for Delphi 5 in the hope that may fix the problem. Does anyone know what was the last version for D5 and where I can get it from?

 

Also, can anyone think what may be causing random node freeing bugs in this way? I appreciate there could be many causes and I have provided hardly any info! But if anyone can think of anything that might be the cause it would be appreciated. Pulling out what little hair I have left!

 

Share this post


Link to post
40 minutes ago, Mark Williams said:

where I can get it from?

Github repo

40 minutes ago, Mark Williams said:

what may be causing random node freeing bugs in this way?

Most likely - double free when VTV's OnFreeNode disposes linked object and it also gets freed somewhere else

  • Thanks 1

Share this post


Link to post

A quick google tells me that VTV 5 dropped support for Delphi 5 and 6, and that the last VTV 4 was 4.8.7, but I have no idea whether this is accurate  I have downloads only back to VTV 6.3.

  • Thanks 1

Share this post


Link to post
16 minutes ago, Fr0sT.Brutal said:

Github repo

Googled Github Repository. No VTV in there. Any idea where I might find it

 

I'll double check all tree data usage. Pretty sure there is nothing there that should cause problem, but could be wrong.

Share this post


Link to post
37 minutes ago, Mark Williams said:

I can only find as far back as 6.2.0, which does not appear to support Delphi 5

Have you cloned whole repo? Mine starts from 2009 with 4.8 mentioned

Share this post


Link to post
On 1/27/2022 at 12:33 PM, Fr0sT.Brutal said:

Most likely - double free when VTV's OnFreeNode disposes linked object and it also gets freed somewhere else

Double-checked all tree code. The tree data does not link objects. They reference objectlists, but the tree data merely references an index to the objects in the objectlist. I've double-checked that I'm the object referenced by the index stored in tree data exists before attempting to refer to it. All that seems okay.

 

I've also wrapped all freenode event code in try except.

 

Still at a loss as to what is causing the problem.

Share this post


Link to post
On 1/27/2022 at 12:51 PM, Mark Williams said:

I have made numerous small changes to the project in the last few weeks. I am now randomly getting errors when closing forms (including those which do not include TVirtualStringTree. The error arises from the  freeing if tree nodes. No clue in the error report as to which treeview. I have tried to replicate the error by repeating the same steps to no avail. It is quite random.

If application worked correctly before the changes, then those code changes will be the cause of the issue, not the TreeView. I suggest going back through your changes history, finding out the last good version of your code. By comparing the code between good and bad version you can more easily pinpoint the real cause.

Share this post


Link to post
8 hours ago, Dalija Prasnikar said:

If application worked correctly before the changes, then those code changes will be the cause of the issue, not the TreeView. I suggest going back through your changes history, finding out the last good version of your code. By comparing the code between good and bad version you can more easily pinpoint the real cause.

Because there are so many changes and the issue is random, I have been trying to avoid a bit by bit reversal, but it is looking as if I have no alternative!

Share this post


Link to post
On 1/27/2022 at 3:19 PM, Fr0sT.Brutal said:

Have you cloned whole repo? Mine starts from 2009 with 4.8 mentioned

I have cloned the repository, but can find no reference to 2009. You mention cloning the "whole" repository. I guess I am not doing that. How do you get the whole repository from Github?

Share this post


Link to post
14 hours ago, Mark Williams said:

I have cloned the repository, but can find no reference to 2009. You mention cloning the "whole" repository. I guess I am not doing that. How do you get the whole repository from Github?

as usual - "git clone https://github.com/Virtual-TreeView/Virtual-TreeView"

tried it right now

1st commit is "SHA-1: de020c14407480a457ecea6d2acd2548bd317161 Cleaning up, converting old library repository into a pure Virtual Treeview repository." from 13.06.2009

I can't figure out how to reach 1st commit via Github UI because there's only Prev & Next buttons (silly!) but clone works OK.

 

Share this post


Link to post

I have a zipped Virtual Treeview archive from 2004, it contains packages for Delphi 4 - Delphi 9 (2005?). If anybody is interested, I can share it. Also found the installer for VTV 4.8.7, dated 15.12.2010.

Edited by Alexander Elagin
added info on 4.8.7

Share this post


Link to post
7 hours ago, Alexander Elagin said:

I have a zipped Virtual Treeview archive from 2004, it contains packages for Delphi 4 - Delphi 9 (2005?). If anybody is interested, I can share it. Also found the installer for VTV 4.8.7, dated 15.12.2010.

Yes please

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×