* pas2jni: Fixed memory leaks when using inherited TP-style objects.

git-svn-id: trunk@34842 -
This commit is contained in:
yury 2016-11-07 21:19:17 +00:00
parent d9e00bf43c
commit 8e8521c43e

View File

@ -676,7 +676,11 @@ begin
ctObject, ctRecord:
begin
Fjs.WriteLn('private native void __Destroy(long pasobj);');
Fjs.WriteLn(Format('protected %s(long objptr, boolean cleanup) { __Init(objptr, cleanup); }', [d.Name]));
if d.AncestorClass = nil then
s:='__Init'
else
s:='super';
Fjs.WriteLn(Format('protected %s(long objptr, boolean cleanup) { %s(objptr, cleanup); }', [d.Name, s]));
Fjs.WriteLn(Format('public %s() { __Init(0, true); }', [d.Name]));
Fjs.WriteLn(Format('public void __Release() { __Destroy(_pasobj); _pasobj=0; }', [d.Name]));
Fjs.WriteLn(Format('public int __Size() { return __Size(%d); }', [FRecords.Add(d)]));