diff --git a/ide/codecontextform.pas b/ide/codecontextform.pas index a4ded966bd..9084d74eaf 100644 --- a/ide/codecontextform.pas +++ b/ide/codecontextform.pas @@ -75,6 +75,7 @@ type FProcNameCodeXYPos: TCodeXYPosition; FSourceEditorTopIndex: integer; FBtnWidth: integer; + fDestroying: boolean; procedure CreateHints(const CodeContexts: TCodeContextInfo); procedure ClearMarksInHints; function GetHints(Index: integer): TCodeContextItem; @@ -1110,6 +1111,7 @@ end; procedure TCodeContextFrm.SetIdleConnected(AValue: boolean); begin + if fDestroying then AValue:=false; if FIdleConnected=AValue then Exit; FIdleConnected:=AValue; if IdleConnected then @@ -1149,7 +1151,8 @@ end; destructor TCodeContextFrm.Destroy; begin - Application.RemoveAllHandlersOfObject(Self); + fDestroying:=true; + IdleConnected:=false; if CodeContextFrm=Self then CodeContextFrm:=nil; inherited Destroy; diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index 85ba187e36..5279697c84 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -2262,7 +2262,7 @@ type FVertical: Boolean; FOnChange: TNotifyEvent; function GetAlign: TAlign; - procedure SetAlign(aValue: TAlign); + procedure SetAlign(aValue: TAlign); reintroduce; procedure SetBands(aValue: TCoolBands); procedure SetBitmap(aValue: TBitmap); procedure SetImages(aValue: TCustomImageList);