memory leak in TDBImage
Original Reporter info from Mantis: eara
-
Reporter name: Stratis Aravias
Original Reporter info from Mantis: eara
- Reporter name: Stratis Aravias
Description:
memory leak detected in TDBImage.LoadPicture procedure when your underlying dataset has no images.
Steps to reproduce:
i use SQLite as db and a table with a blob field for storing images. So make a form with TDBNavigator and the TDBImage component and the rest necessary components for connecting to underyling table (connection,transaction,query,datasource)
Then just create a few records (or one) and just navigate on them without inserting any image. When i shut down the application i get report for memory leaks that refer also this procedure.
Additional information:
Taking a closer look in TDBImage.LoadPicture (dbimage.inc) i see that in line 151 we have an exit procedure command, without Free the s variable.
I suggest to add the following line just before "exit;" command on line 151:
150: Picture.Clear;
ADD THIS 151: if(s<>nil)then s.Free;
152: exit;
which seems to fix my issue;
Mantis conversion info:
- Mantis ID: 25750
- OS: Windows
- OS Build: 7
- Version: 2.3 (SVN)
- Fixed in version: 1.3 (SVN)
- Fixed in revision: 44334 (#ca052fe4)
- Monitored by: » eara (Stratis Aravias)
- Target version: 1.4