Recent

Author Topic: Memory leak by calling TAsyncProcess.Execute?  (Read 1977 times)

FangQ

  • Full Member
  • ***
  • Posts: 135
Memory leak by calling TAsyncProcess.Execute?
« on: July 05, 2017, 11:45:15 pm »
hi, heaptrc detects a number of memory leakage, all pointing to a line where I call TAsyncProcess.Execute to launch an external program. Here is the  heaptrc log:

Code: Pascal  [Select][+][-]
  1. Heap dump by heaptrc unit
  2. 52280 memory blocks allocated : 10764537/10892656
  3. 52276 memory blocks freed     : 10764345/10892464
  4. 4 unfreed memory blocks : 192
  5. True heap size : 2883584
  6. True free heap : 2882816
  7. Should be : 2882880
  8. Call trace for block $00007FD5A4A524C0 size 48
  9.   $000000000056739A line 44 of include/lclintf.inc
  10.   $00000000007A2C3E line 106 of asyncprocess.pp
  11.   $0000000000462036 line 524 of mcxgui.pas
  12.   $0000000000499BAC
  13.   $00000000006C758D line 246 of include/customaction.inc
  14.   $000000000049988F
  15.   $00000000006692D9 line 826 of include/toolbutton.inc
  16. Call trace for block $00007FD5A3D0AA40 size 48
  17.   $000000000056739A line 44 of include/lclintf.inc
  18.   $00000000007A2C3E line 106 of asyncprocess.pp
  19.   $0000000000465017 line 877 of mcxgui.pas
  20.   $0000000000499BAC
  21.   $00000000006C758D line 246 of include/customaction.inc
  22.   $000000000049988F
  23.   $00000000006692D9 line 826 of include/toolbutton.inc
  24. Call trace for block $00007FD5A3D09E40 size 48
  25.   $000000000056739A line 44 of include/lclintf.inc
  26.   $00000000007A2C3E line 106 of asyncprocess.pp
  27.   $0000000000462036 line 524 of mcxgui.pas
  28.   $0000000000499BAC
  29.   $00000000006C758D line 246 of include/customaction.inc
  30.   $000000000049988F
  31.   $00000000006692D9 line 826 of include/toolbutton.inc
  32. Call trace for block $00007FD5A3D0A800 size 48
  33.   $000000000056739A line 44 of include/lclintf.inc
  34.   $00000000007A2C3E line 106 of asyncprocess.pp
  35.   $0000000000465017 line 877 of mcxgui.pas
  36.   $0000000000499BAC
  37.   $00000000006C758D line 246 of include/customaction.inc
  38.   $000000000049988F
  39.   $00000000006692D9 line 826 of include/toolbutton.inc
  40.  

all the lines are identical as

Code: Pascal  [Select][+][-]
  1. pMCX.Execute;

for example, Line#524: https://github.com/fangq/mcx/blob/master/mcxstudio/mcxgui.pas#L524

do I need to do anything after calling Execute? thanks

 

TinyPortal © 2005-2018