* * *

Author Topic: how to free TvVectorialDocument  (Read 541 times)

eraaijma

  • New member
  • *
  • Posts: 21
how to free TvVectorialDocument
« on: May 10, 2017, 06:40:58 pm »
I am struggling freeing memory after the VectorDocument is loaded from Tmemorystream.

I have included a little project.
Once any 'test.jpg' is added and 'test.dxf', you will notice that jpegs tend not to use more memory and every DXF takes a new chunk of memory.

The question remains: How to free up memory?

zamtmn

  • Sr. Member
  • ****
  • Posts: 275
Re: how to free TvVectorialDocument
« Reply #1 on: May 13, 2017, 10:05:09 pm »
Try use heaptrc to locate memory leaks?
« Last Edit: May 14, 2017, 10:35:49 am by zamtmn »

wp

  • Hero Member
  • *****
  • Posts: 3512
Re: how to free TvVectorialDocument
« Reply #2 on: May 14, 2017, 12:00:37 am »
There were several memory leaks in the dxf reader. Please test r54901 of Lazarus trunk.
Lazarus trunk / fpc 3.0.0 / Win32

eraaijma

  • New member
  • *
  • Posts: 21
Re: how to free TvVectorialDocument
« Reply #3 on: May 24, 2017, 09:16:40 am »
@zamtm:
That would be a new skil for me. I thought the problem started in the dxfreader, which was confirmed by 'wp'. Dxfreader takes a while to understand. I cannot go in and poke around. Thanks anyway.

@wp:
Could you send a link please to r54901. I cannot find it. Would be interesting to see what is reported.
Thanks also.

wp

  • Hero Member
  • *****
  • Posts: 3512
Re: how to free TvVectorialDocument
« Reply #4 on: May 24, 2017, 09:36:56 am »
@eraaijma: I don't understand what you mean...

The fix is included in the development version of Lazarus (trunk). So, if you use trunk and update your repository you will get it automatically. Alternatively, you may try to copy the dxfreader file from https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/fpvectorial/dxfvectorialreader.pas?view=co&root=lazarus to the folder components/fpvectorial of your lazarus installation (make a backup copy of the file first!) - but I cannot guarantee if this will work because there may be other changes between trunk and your version.

Alternatively, the fix will be backported to Lazarus 1.8. However, it is not yet contained in the current release candidate 1.8RC1, you must wait for 1.8RC2.
Lazarus trunk / fpc 3.0.0 / Win32

zamtmn

  • Sr. Member
  • ****
  • Posts: 275
Re: how to free TvVectorialDocument
« Reply #5 on: May 24, 2017, 08:35:24 pm »
@eraaijma
If you use FPvectorial, you definitely need to use trunk lazarus. And very desirable to make bugreports and patches))

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus