1) Maybe it was not always the case, but tobjectdef.vmtentries is never nil (initialised to an empty list @ .create & @ .ppuload. With the following two exceptions, there are no other assigned(vmtentries) checks before dereferencing. I propose that these two useless checks be removed.
@ TVMTWriter.writevirtualmethod :
if not assigned(_class.VMTEntries) then // <-- 1) USELESS: ALWAYS FALSE exit;> for i:=0 to _class.VMTEntries.Count-1 do
@ tobjectdef.getcopy :
Show quoted text 5 lines
2) More importantly, the above snipped leaks an empty TFPList when non-nil result.vmtentries is overwritten.
3) Bonus: @ tobjectdef.destroy : under "if assigned(vmtentries)", using vmtentries.free instead of .Destroy makes no sense.
The attached patch remedies all the above.
