mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 17:59:25 +02:00
* set finalized dynarrays to nil (mantis #12048)
git-svn-id: trunk@11773 -
This commit is contained in:
parent
597622d313
commit
f9b4d58e98
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8544,6 +8544,7 @@ tests/webtbs/tw11937.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12000.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1203.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1204.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12048.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12050a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12050b.pp svneol=native#text/plain
|
||||
tests/webtbs/tw12051.pp svneol=native#text/plain
|
||||
|
@ -179,7 +179,10 @@ begin
|
||||
PPointer(Data)^:=nil;
|
||||
end;
|
||||
tkDynArray:
|
||||
fpc_dynarray_decr_ref(PPointer(Data)^,TypeInfo);
|
||||
begin
|
||||
fpc_dynarray_decr_ref(PPointer(Data)^,TypeInfo);
|
||||
PPointer(Data)^:=nil;
|
||||
end;
|
||||
tkVariant:
|
||||
variant_clear(PVarData(Data)^);
|
||||
end;
|
||||
|
24
tests/webtbs/tw12048.pp
Normal file
24
tests/webtbs/tw12048.pp
Normal file
@ -0,0 +1,24 @@
|
||||
{ %opt=-gh }
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
program DynArrBug;
|
||||
|
||||
uses Types;
|
||||
|
||||
function GetDynArray: TStringDynArray;
|
||||
begin
|
||||
SetLength( GetDynArray, 16 );
|
||||
end;
|
||||
|
||||
var
|
||||
darr: array[1..1] of TStringDynArray;
|
||||
begin
|
||||
keepreleased:=true;
|
||||
darr[1] := GetDynArray();
|
||||
Finalize( darr[1] );
|
||||
if pointer(darr[1])<>nil then
|
||||
halt(1);
|
||||
darr[1] := GetDynArray();
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user