* decr ref doesn't reset pointer

* finalize resets pointer for astring,wstring
This commit is contained in:
peter 2004-07-02 21:21:09 +00:00
parent 695b29bab3
commit 59691cc142
3 changed files with 34 additions and 9 deletions

View File

@ -115,7 +115,9 @@ Begin
If declocked(l^) then If declocked(l^) then
{ Ref count dropped to zero } { Ref count dropped to zero }
DisposeAnsiString (S); { Remove...} DisposeAnsiString (S); { Remove...}
{$ifndef decrrefnotnil}
s:=nil; s:=nil;
{$endif}
end; end;
{$ifdef hascompilerproc} {$ifdef hascompilerproc}
@ -876,7 +878,11 @@ end;
{ {
$Log$ $Log$
Revision 1.45 2004-05-29 15:39:08 florian Revision 1.46 2004-07-02 21:21:09 peter
* decr ref doesn't reset pointer
* finalize resets pointer for astring,wstring
Revision 1.45 2004/05/29 15:39:08 florian
* the decr functions set the data now to nil * the decr functions set the data now to nil
Revision 1.44 2004/05/16 16:52:28 peter Revision 1.44 2004/05/16 16:52:28 peter

View File

@ -162,10 +162,16 @@ begin
Temp:=PByte(TypeInfo); Temp:=PByte(TypeInfo);
case temp^ of case temp^ of
tkAstring : tkAstring :
begin
fpc_AnsiStr_Decr_Ref(PPointer(Data)^); fpc_AnsiStr_Decr_Ref(PPointer(Data)^);
PPointer(Data)^:=nil;
end;
{$ifdef HASWIDESTRING} {$ifdef HASWIDESTRING}
tkWstring : tkWstring :
begin
fpc_WideStr_Decr_Ref(PPointer(Data)^); fpc_WideStr_Decr_Ref(PPointer(Data)^);
PPointer(Data)^:=nil;
end;
{$endif HASWIDESTRING} {$endif HASWIDESTRING}
tkArray : tkArray :
begin begin
@ -206,7 +212,10 @@ begin
end; end;
{$ifdef HASINTF} {$ifdef HASINTF}
tkInterface: tkInterface:
begin
Intf_Decr_Ref(PPointer(Data)^); Intf_Decr_Ref(PPointer(Data)^);
PPointer(Data)^:=nil;
end;
{$endif HASINTF} {$endif HASINTF}
tkDynArray: tkDynArray:
fpc_dynarray_decr_ref(PPointer(Data)^,TypeInfo); fpc_dynarray_decr_ref(PPointer(Data)^,TypeInfo);
@ -372,7 +381,11 @@ procedure fpc_finalize_array(data,typeinfo : pointer;count,size : longint); [Pub
{ {
$Log$ $Log$
Revision 1.12 2004-05-31 20:25:04 peter Revision 1.13 2004-07-02 21:21:09 peter
* decr ref doesn't reset pointer
* finalize resets pointer for astring,wstring
Revision 1.12 2004/05/31 20:25:04 peter
* removed warnings * removed warnings
Revision 1.11 2004/03/27 23:22:38 florian Revision 1.11 2004/03/27 23:22:38 florian

View File

@ -201,7 +201,9 @@ Begin
If declocked(l^) then If declocked(l^) then
{ Ref count dropped to zero } { Ref count dropped to zero }
DisposeWideString (S); { Remove...} DisposeWideString (S); { Remove...}
{$ifndef decrrefnotnil}
s:=nil; s:=nil;
{$endif}
end; end;
{$ifdef hascompilerproc} {$ifdef hascompilerproc}
@ -1042,7 +1044,11 @@ end;
{ {
$Log$ $Log$
Revision 1.39 2004-05-31 14:31:57 peter Revision 1.40 2004-07-02 21:21:09 peter
* decr ref doesn't reset pointer
* finalize resets pointer for astring,wstring
Revision 1.39 2004/05/31 14:31:57 peter
* remove comment warnings * remove comment warnings
Revision 1.38 2004/05/29 15:39:08 florian Revision 1.38 2004/05/29 15:39:08 florian