jdelauney / TGIFViewer

TGIFViewer composant visuel pour l'affichage d'animations au format GIF (Graphic Interchange Format) avec Free Pascal et Lazarus
Mozilla Public License 2.0
18 stars 2 forks source link

Memory leak #11

Closed bpranoto closed 4 years ago

bpranoto commented 4 years ago

There are memory leaks in this component.

Environment: O/S: Ubuntu 18.04 64bits Lazarus: version 2.0.2 fpc: versin 3.0.4

Steps to reproduce:

  1. Open the project demo in demos/GIFView directory Set the project option -> Compiler Options -> Debugging, enable use of Heaptrc unit for tracking memory leaks.

  2. Compile and run

  3. Drop the fpclogo.gif from demos/GIFView

  4. Close the demo app.

Here is the memory leaks reported by heaptrc:

Heap dump by heaptrc unit 44915 memory blocks allocated : 3792991/3872760 44867 memory blocks freed : 3565799/3645552 48 unfreed memory blocks : 227192 True heap size : 1376256 True free heap : 1141280 Should be : 1142904 Call trace for block $00007FFFF7F18AE0 size 184 $000000000054B0B5 line 277 of include/rasterimage.inc $000000000054D16D line 50 of include/custombitmap.inc $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFE0013C00 size 120 $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas $00000000006A5A81 line 7821 of qt5/qtwidgets.pas $00007FFFF76D63DB line 63 of tmp/../src/qobject_hook.h Call trace for block $00007FFFF7F18820 size 184 $000000000054B0B5 line 277 of include/rasterimage.inc $000000000054D16D line 50 of include/custombitmap.inc $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFE00139C0 size 120 $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas $00000000006A5A81 line 7821 of qt5/qtwidgets.pas $00007FFFF76D63DB line 63 of tmp/../src/qobject_hook.h Call trace for block $00007FFFF7F18560 size 184 $000000000054B0B5 line 277 of include/rasterimage.inc $000000000054D16D line 50 of include/custombitmap.inc $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFE0013780 size 120 $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas $00000000006A5A81 line 7821 of qt5/qtwidgets.pas $00007FFFF76D63DB line 63 of tmp/../src/qobject_hook.h Call trace for block $00007FFFF7F182A0 size 184 $000000000054B0B5 line 277 of include/rasterimage.inc $000000000054D16D line 50 of include/custombitmap.inc $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFE0013540 size 120 $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas $00000000006A5A81 line 7821 of qt5/qtwidgets.pas $00007FFFF76D63DB line 63 of tmp/../src/qobject_hook.h Call trace for block $00007FFFF7F17FE0 size 184 $000000000054B0B5 line 277 of include/rasterimage.inc $000000000054D16D line 50 of include/custombitmap.inc $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7FB37E0 size 120 $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas $00000000006A5A81 line 7821 of qt5/qtwidgets.pas $00007FFFF76D63DB line 63 of tmp/../src/qobject_hook.h Call trace for block $00007FFFF7F17D20 size 184 $000000000054B0B5 line 277 of include/rasterimage.inc $000000000054D16D line 50 of include/custombitmap.inc $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7FB3FC0 size 120 $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas $00000000006A5A81 line 7821 of qt5/qtwidgets.pas $00007FFFF76D63DB line 63 of tmp/../src/qobject_hook.h Call trace for block $00007FFFF7F174E0 size 184 $000000000054B0B5 line 277 of include/rasterimage.inc $000000000054D16D line 50 of include/custombitmap.inc $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7FB40E0 size 120 $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas $00000000006A5A81 line 7821 of qt5/qtwidgets.pas $00007FFFF76D63DB line 63 of tmp/../src/qobject_hook.h Call trace for block $00007FFFF7F17900 size 184 $000000000054B0B5 line 277 of include/rasterimage.inc $000000000054D16D line 50 of include/custombitmap.inc $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7FB4560 size 120 $00000000007850A8 line 2334 of ../../source/uGifViewer.pas $0000000000785190 line 2350 of ../../source/uGifViewer.pas $0000000000785C88 line 2541 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas $00000000006A5A81 line 7821 of qt5/qtwidgets.pas $00007FFFF76D63DB line 63 of tmp/../src/qobject_hook.h Call trace for block $00007FFFCC10CF90 size 28304 $0000000000781B62 line 1559 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7FB3900 size 120 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7E95540 size 40 $0000000000780804 line 774 of ../../source/uGifViewer.pas $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas Call trace for block $00007FFFF7F16740 size 48 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFCC106970 size 25984 $0000000000781B62 line 1559 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7FB3480 size 120 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7E9F7C0 size 40 $0000000000780804 line 774 of ../../source/uGifViewer.pas $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas Call trace for block $00007FFFF7E9FA00 size 48 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7FA7430 size 27612 $0000000000781B62 line 1559 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7FB3120 size 120 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7E6F400 size 40 $0000000000780804 line 774 of ../../source/uGifViewer.pas $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas Call trace for block $00007FFFF7E5E380 size 48 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFCC0FF0D0 size 30720 $0000000000781B62 line 1559 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7FB3A20 size 120 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7E6EB00 size 40 $0000000000780804 line 774 of ../../source/uGifViewer.pas $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas Call trace for block $00007FFFF7EC59C0 size 48 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7FA15F0 size 23940 $0000000000781B62 line 1559 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7FB3C60 size 120 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7F120C0 size 40 $0000000000780804 line 774 of ../../source/uGifViewer.pas $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas Call trace for block $00007FFFF7E99BC0 size 48 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7F9AB90 size 27060 $0000000000781B62 line 1559 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7FB4440 size 120 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7F24700 size 40 $0000000000780804 line 774 of ../../source/uGifViewer.pas $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas Call trace for block $00007FFFF7F24640 size 48 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7F94570 size 25960 $0000000000781B62 line 1559 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFE00131E0 size 120 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7E73240 size 40 $0000000000780804 line 774 of ../../source/uGifViewer.pas $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas Call trace for block $00007FFFF7E6FA00 size 48 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $000000000078199B line 1518 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7F8C1D0 size 33516 $0000000000781B62 line 1559 of ../../source/uGifViewer.pas $00000000007816D6 line 1867 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFE00130C0 size 120 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $0000000000781654 line 1843 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas Call trace for block $00007FFFF7E97280 size 40 $0000000000780804 line 774 of ../../source/uGifViewer.pas $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $0000000000781654 line 1843 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc Call trace for block $00007FFFF7EA24C0 size 48 $0000000000780AA6 line 825 of ../../source/uGifViewer.pas $0000000000781654 line 1843 of ../../source/uGifViewer.pas $0000000000781391 line 948 of ../../source/uGifViewer.pas $000000000078141E line 960 of ../../source/uGifViewer.pas $0000000000785C0F line 2536 of ../../source/uGifViewer.pas $00000000004684D7 line 207 of umainform.pas $0000000000458544 line 2656 of include/customform.inc $000000000069BD9B line 2958 of qt5/qtwidgets.pas

bpranoto commented 4 years ago

I fix the memory leaks.

Attached is the diff file. memory_leak_fix.diff.txt

jdelauney commented 4 years ago

Thanks bpranoto is fixed

bpranoto commented 4 years ago

You still don't incorporate one of my fixes in uGifViewer.pas

----8< Original code Here is your code on TGIFImageList.Clear; Procedure TGIFImageList.Clear; Var anItem: TGIFImageListItem; i: Integer; Begin Inherited Clear; If Count > 0 Then ===> PROBLEM: Count will be zero Begin For i := Count - 1 Downto 0 do Begin AnItem := Items[i]; If anItem <> nil Then anItem.Free; End; End; End;

We should call inherited Clear after the loop: If Count > 0 Then Begin For i := Count - 1 Downto 0 do Begin AnItem := Items[i]; If anItem <> nil Then anItem.Free; End; End; Inherited Clear; // <== should be called after the loop

bpranoto commented 4 years ago

memory_leak_fix_2.diff.txt

jdelauney commented 4 years ago

Thanks again i didn't take care of this fix, in your prevoius patch. Overriding Destroy is not necessary here ;)

Best regards

jdelauney commented 4 years ago

Hum i'm just discover an another memory leak, i must investigate

jdelauney commented 4 years ago

It's ok i found, was appear when you click on Transparent checkbox. In procedure TGIFViewer.RenderFrame(Index : Integer); FRestoreBitmap was not free if assigned.

So normaly now all memory leaks are fixed

Thanks again

bpranoto commented 4 years ago

Seems all is good now. Thank you very much for this excellent work.