Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-12

win32 interface: CheckListBox memleak.

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Vincent Snijders

Hi,

I investigated why sometimes the ItemRecords of a checklistbox aren't freeed. What happens is, that the LCL sends a LM_DESTROY message to the interface for the checklistbox. The interface removes the Lazarus property from the checklistbox window. Therefore when the windows is destroyed and the WM_DESTROY message is received, the owner object is nil and we don't know what (type) the original lcl object was.

I propose that we remove the line (around line 583 of win32object.inc)
  RemoveProp(Handle, 'Lazarus');

Then when the WM_DESTROY message is received in the windows procedure, there is still a owner object.

The Lazarus property will be removed by the enumprops call later in the WM_DESTROY handling code.

Regards,
Vincent.

Reply by email

Micha Nelissen
to Vincent Snijders
Vincent Snijders wrote 15 lines
I investigated why sometimes the ItemRecords of a checklistbox aren't freeed. What happens is, that the LCL sends a LM_DESTROY message to the interface for the checklistbox. The interface removes the Lazarus property from the checklistbox window. Therefore when the windows is destroyed and the WM_DESTROY message is received, the owner object is nil and we don't know what (type) the original lcl object was. I propose that we remove the line (around line 583 of win32object.inc) RemoveProp(Handle, 'Lazarus'); Then when the WM_DESTROY message is received in the windows procedure, there is still a owner object. The Lazarus property will be removed by the enumprops call later in the WM_DESTROY handling code.

Good idea, applied.

Thanks,

Micha.

Reply by email