mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 16:09:31 +02:00
* pas2jni: Fixed memory leaks when using inherited TP-style objects.
git-svn-id: trunk@34842 -
This commit is contained in:
parent
d9e00bf43c
commit
8e8521c43e
@ -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)]));
|
||||
|
Loading…
Reference in New Issue
Block a user