diff --git a/lcl/include/dragmanager.inc b/lcl/include/dragmanager.inc index 1770e05bfb..c14c0e254f 100644 --- a/lcl/include/dragmanager.inc +++ b/lcl/include/dragmanager.inc @@ -267,7 +267,7 @@ var APoint: TPoint; begin inherited Create(AManager, AControl); - AControl.DoStartDock(FDockObject); + AControl.DoStartDock(TDragObject(FDockObject)); if FDockObject = nil then FDockObject := TDragDockObject.AutoCreate(AControl); diff --git a/lcl/lclproc.pas b/lcl/lclproc.pas index 2613e89fb5..8c4a8cf6cb 100644 --- a/lcl/lclproc.pas +++ b/lcl/lclproc.pas @@ -146,7 +146,7 @@ var function SendApplicationMessage(Msg: Cardinal; WParam: WParam; LParam: LParam):Longint; procedure OwnerFormDesignerModified(AComponent: TComponent); -procedure FreeThenNil(var AnObject: TObject); +procedure FreeThenNil(var obj); { the LCL interfaces finalization sections are called before the finalization sections of the LCL. Those parts, that should be finalized after the LCL, can @@ -1326,11 +1326,12 @@ Begin Result := False; end; -procedure FreeThenNil(var AnObject: TObject); +procedure FreeThenNil(var obj); begin - if AnObject<>nil then begin - AnObject.Free; - AnObject:=nil; + if Pointer(obj) <> nil then + begin + TObject(obj).Free; + Pointer(obj) := nil; end; end;