From 048ad30635563c58a664c0d7db2bc7e770f335d9 Mon Sep 17 00:00:00 2001 From: inoussa Date: Tue, 19 Nov 2013 10:52:20 +0000 Subject: [PATCH] Make "FreeObjectProperties" a method of TBaseRemotable git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2839 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- wst/trunk/base_service_intf.pas | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/wst/trunk/base_service_intf.pas b/wst/trunk/base_service_intf.pas index c1b05943c..26277cccf 100644 --- a/wst/trunk/base_service_intf.pas +++ b/wst/trunk/base_service_intf.pas @@ -264,6 +264,10 @@ type TBaseRemotable = class(TPersistent) Public constructor Create();virtual; + destructor Destroy();override; + // This will free objects and arrays properties and set them to nil. + procedure FreeObjectProperties();virtual; + class procedure Save( AObject : TBaseRemotable; AStore : IFormatterBase; @@ -547,8 +551,6 @@ type var AName : string; const ATypeInfo : PTypeInfo );override; - // This will free objects and arrays properties and set them to nil. - procedure FreeObjectProperties();virtual; end; TRemotableRecordEncoderClass = class of TRemotableRecordEncoder; @@ -2038,6 +2040,17 @@ constructor TBaseRemotable.Create(); begin end; +destructor TBaseRemotable.Destroy(); +begin + FreeObjectProperties(); + inherited Destroy(); +end; + +procedure TBaseRemotable.FreeObjectProperties(); +begin + //Derived classes should override this method to free their object(s) and array(s). +end; + function TBaseRemotable.Equal(const ACompareTo : TBaseRemotable) : Boolean; begin Result := ( Self = ACompareTo ); @@ -2578,11 +2591,6 @@ begin end; {$ENDIF USE_SERIALIZE} -procedure TBaseComplexRemotable.FreeObjectProperties(); -begin - //Derived classes should override this method to free their object(s) and array(s). -end; - { TBaseObjectArrayRemotable } function TBaseObjectArrayRemotable.GetItem(AIndex: Integer): TBaseRemotable;