You've already forked lazarus-ccr
Introduce "FreeObjectProperties()" method in TBaseComplexRemotable to allow its derived classes to clear (FreeAndNil) their object(s) and array(s) properties.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@910 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -115,7 +115,7 @@ type
|
|||||||
FProp_String : string;
|
FProp_String : string;
|
||||||
public
|
public
|
||||||
constructor Create();override;
|
constructor Create();override;
|
||||||
destructor Destroy();override;
|
procedure FreeObjectProperties();override;
|
||||||
class function GetNameSpace() : string;virtual;
|
class function GetNameSpace() : string;virtual;
|
||||||
published
|
published
|
||||||
property Prop_String : string Read FProp_String Write FProp_String;
|
property Prop_String : string Read FProp_String Write FProp_String;
|
||||||
@ -472,11 +472,11 @@ begin
|
|||||||
FProp_B := TNameSpaceB_Class.Create();
|
FProp_B := TNameSpaceB_Class.Create();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TNameSpaceC_Class.Destroy();
|
procedure TNameSpaceC_Class.FreeObjectProperties();
|
||||||
begin
|
begin
|
||||||
FreeAndNil(FProp_B);
|
FreeAndNil(FProp_B);
|
||||||
FreeAndNil(FProp_A);
|
FreeAndNil(FProp_A);
|
||||||
inherited Destroy();
|
inherited FreeObjectProperties();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TNameSpaceC_Class.GetNameSpace() : string;
|
class function TNameSpaceC_Class.GetNameSpace() : string;
|
||||||
|
@ -33,10 +33,10 @@ type
|
|||||||
TWstBaseTest = class(TTestCase)
|
TWstBaseTest = class(TTestCase)
|
||||||
protected
|
protected
|
||||||
procedure CheckEquals(expected, actual: TByteDynArray; msg: string = ''; const AStrict : Boolean = True); overload;
|
procedure CheckEquals(expected, actual: TByteDynArray; msg: string = ''; const AStrict : Boolean = True); overload;
|
||||||
procedure CheckEquals(expected, actual: Currency; msg: string = ''); overload;
|
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
procedure CheckEquals(expected, actual: Int64; msg: string = ''; const AStrict : Boolean = True); overload;
|
procedure CheckEquals(expected, actual: Int64; msg: string = ''; const AStrict : Boolean = True); overload;
|
||||||
procedure CheckEquals(expected, actual: QWord; msg: string = ''; const AStrict : Boolean = True); overload;
|
procedure CheckEquals(expected, actual: QWord; msg: string = ''; const AStrict : Boolean = True); overload;
|
||||||
|
procedure CheckEquals(expected, actual: Currency; msg: string = ''); overload;
|
||||||
{$ENDIF FPC}
|
{$ENDIF FPC}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -159,6 +159,12 @@ begin
|
|||||||
if (expected <> actual) then
|
if (expected <> actual) then
|
||||||
FailNotEquals(IntToStr(expected), IntToStr(actual), msg{$IFDEF WST_DELPHI}, CallerAddr{$ENDIF WST_DELPHI});
|
FailNotEquals(IntToStr(expected), IntToStr(actual), msg{$IFDEF WST_DELPHI}, CallerAddr{$ENDIF WST_DELPHI});
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TWstBaseTest.CheckEquals(expected, actual : Currency; msg : string);
|
||||||
|
begin
|
||||||
|
if (expected <> actual) then
|
||||||
|
FailNotEquals(CurrToStr(expected), CurrToStr(actual), msg{$IFDEF WST_DELPHI}, CallerAddr{$ENDIF WST_DELPHI});
|
||||||
|
end;
|
||||||
{$ENDIF FPC}
|
{$ENDIF FPC}
|
||||||
|
|
||||||
procedure TWstBaseTest.CheckEquals(expected, actual: TByteDynArray;
|
procedure TWstBaseTest.CheckEquals(expected, actual: TByteDynArray;
|
||||||
@ -174,10 +180,5 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWstBaseTest.CheckEquals(expected, actual : Currency; msg : string);
|
|
||||||
begin
|
|
||||||
if (expected <> actual) then
|
|
||||||
FailNotEquals(CurrToStr(expected), CurrToStr(actual), msg{$IFDEF WST_DELPHI}, CallerAddr{$ENDIF WST_DELPHI});
|
|
||||||
end;
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -77,7 +77,7 @@ type
|
|||||||
FVal_StringArray: TArrayOfStringRemotable;
|
FVal_StringArray: TArrayOfStringRemotable;
|
||||||
public
|
public
|
||||||
constructor Create();override;
|
constructor Create();override;
|
||||||
destructor Destroy();override;
|
procedure FreeObjectProperties();override;
|
||||||
Published
|
Published
|
||||||
property Val_Enum : TTestEnum Read FVal_Enum Write FVal_Enum;
|
property Val_Enum : TTestEnum Read FVal_Enum Write FVal_Enum;
|
||||||
property Val_Bool : Boolean Read FVal_Bool Write FVal_Bool;
|
property Val_Bool : Boolean Read FVal_Bool Write FVal_Bool;
|
||||||
@ -888,11 +888,11 @@ begin
|
|||||||
FVal_StringArray := TArrayOfStringRemotable.Create();
|
FVal_StringArray := TArrayOfStringRemotable.Create();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TClass_A.Destroy();
|
procedure TClass_A.FreeObjectProperties();
|
||||||
begin
|
begin
|
||||||
FreeAndNil(FVal_StringArray);
|
FreeAndNil(FVal_StringArray);
|
||||||
FreeAndNil(FVal_Obj);
|
FreeAndNil(FVal_Obj);
|
||||||
inherited Destroy();
|
inherited FreeObjectProperties();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TTest_TBaseObjectArrayRemotable }
|
{ TTest_TBaseObjectArrayRemotable }
|
||||||
|
@ -53,7 +53,7 @@ type
|
|||||||
FVal_WideString: WideString;
|
FVal_WideString: WideString;
|
||||||
public
|
public
|
||||||
constructor Create();override;
|
constructor Create();override;
|
||||||
destructor Destroy();override;
|
procedure FreeObjectProperties();override;
|
||||||
Published
|
Published
|
||||||
property Val_32S : LongInt Read FVal_32S Write FVal_32S;
|
property Val_32S : LongInt Read FVal_32S Write FVal_32S;
|
||||||
property Val_Enum : TTestEnum Read FVal_Enum Write FVal_Enum;
|
property Val_Enum : TTestEnum Read FVal_Enum Write FVal_Enum;
|
||||||
@ -104,7 +104,7 @@ type
|
|||||||
procedure SetObjProp(const AValue: TClass_A);
|
procedure SetObjProp(const AValue: TClass_A);
|
||||||
Public
|
Public
|
||||||
constructor Create();override;
|
constructor Create();override;
|
||||||
destructor Destroy();override;
|
procedure FreeObjectProperties();override;
|
||||||
Published
|
Published
|
||||||
property Val_32S : LongInt Read FVal_32S Write FVal_32S;
|
property Val_32S : LongInt Read FVal_32S Write FVal_32S;
|
||||||
property Val_Enum : TTestEnum Read FVal_Enum Write FVal_Enum;
|
property Val_Enum : TTestEnum Read FVal_Enum Write FVal_Enum;
|
||||||
@ -310,7 +310,7 @@ type
|
|||||||
FVal_CplxWideString: T_ComplexWideStringContent;
|
FVal_CplxWideString: T_ComplexWideStringContent;
|
||||||
public
|
public
|
||||||
constructor Create();override;
|
constructor Create();override;
|
||||||
destructor Destroy();override;
|
procedure FreeObjectProperties();override;
|
||||||
published
|
published
|
||||||
property Val_CplxInt64S : T_ComplexInt64SContent read FVal_CplxInt64S write FVal_CplxInt64S;
|
property Val_CplxInt64S : T_ComplexInt64SContent read FVal_CplxInt64S write FVal_CplxInt64S;
|
||||||
property Val_CplxInt64U : T_ComplexInt64UContent read FVal_CplxInt64U write FVal_CplxInt64U;
|
property Val_CplxInt64U : T_ComplexInt64UContent read FVal_CplxInt64U write FVal_CplxInt64U;
|
||||||
@ -5037,10 +5037,10 @@ begin
|
|||||||
FObjProp := TClass_A.Create();
|
FObjProp := TClass_A.Create();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TClass_B.Destroy();
|
procedure TClass_B.FreeObjectProperties();
|
||||||
begin
|
begin
|
||||||
FreeAndNil(FObjProp);
|
FreeAndNil(FObjProp);
|
||||||
inherited Destroy();
|
inherited FreeObjectProperties();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TTestArray }
|
{ TTestArray }
|
||||||
@ -5546,7 +5546,7 @@ begin
|
|||||||
FVal_CplxInt8U := T_ComplexInt8UContent.Create();
|
FVal_CplxInt8U := T_ComplexInt8UContent.Create();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TClass_CplxSimpleContent.Destroy();
|
procedure TClass_CplxSimpleContent.FreeObjectProperties();
|
||||||
begin
|
begin
|
||||||
FreeAndNil(FVal_CplxInt64S);
|
FreeAndNil(FVal_CplxInt64S);
|
||||||
FreeAndNil(FVal_CplxInt64U);
|
FreeAndNil(FVal_CplxInt64U);
|
||||||
@ -5556,7 +5556,7 @@ begin
|
|||||||
FreeAndNil(FVal_CplxInt16S);
|
FreeAndNil(FVal_CplxInt16S);
|
||||||
FreeAndNil(FVal_CplxInt8U);
|
FreeAndNil(FVal_CplxInt8U);
|
||||||
FreeAndNil(FVal_CplxInt8S);
|
FreeAndNil(FVal_CplxInt8S);
|
||||||
inherited Destroy();
|
inherited FreeObjectProperties();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TTestXmlRpcFormatterAttributes }
|
{ TTestXmlRpcFormatterAttributes }
|
||||||
@ -6310,12 +6310,12 @@ begin
|
|||||||
FVal_Time := TTimeRemotable.Create();
|
FVal_Time := TTimeRemotable.Create();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TClass_A.Destroy();
|
procedure TClass_A.FreeObjectProperties();
|
||||||
begin
|
begin
|
||||||
FreeAndNil(FVal_Time);
|
FreeAndNil(FVal_Time);
|
||||||
FreeAndNil(FVal_Date);
|
FreeAndNil(FVal_Date);
|
||||||
FreeAndNil(FVal_DateTime);
|
FreeAndNil(FVal_DateTime);
|
||||||
inherited Destroy();
|
inherited FreeObjectProperties();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
Reference in New Issue
Block a user