You've already forked lazarus-ccr
* Avoid LCL warning message: use QueueAsyncCall instead of PostMessage to release the edit component
* Fix memory leak when closing an app with an editlink active git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1486 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -3164,12 +3164,14 @@ type
|
||||
// Edit support classes.
|
||||
TStringEditLink = class;
|
||||
|
||||
{ TVTEdit }
|
||||
|
||||
TVTEdit = class(TCustomEdit)
|
||||
private
|
||||
procedure CMAutoAdjust(var Message: TLMessage); message CM_AUTOADJUST;
|
||||
procedure CMExit(var Message: TLMessage); message CM_EXIT;
|
||||
procedure CMRelease(var Message: TLMessage); message CM_RELEASE;
|
||||
procedure CNCommand(var Message: TLMCommand); message CN_COMMAND;
|
||||
procedure DoRelease(Data: PtrInt);
|
||||
procedure WMChar(var Message: TLMChar); message LM_CHAR;
|
||||
procedure WMDestroy(var Message: TLMDestroy); message LM_DESTROY;
|
||||
procedure WMGetDlgCode(var Message: TLMNoParams); message LM_GETDLGCODE;
|
||||
@ -3182,7 +3184,7 @@ type
|
||||
public
|
||||
constructor Create(Link: TStringEditLink); reintroduce;
|
||||
|
||||
procedure Release; virtual;
|
||||
procedure Release;
|
||||
|
||||
property AutoSelect;
|
||||
property AutoSize;
|
||||
@ -11326,7 +11328,6 @@ begin
|
||||
StopWheelPanning;
|
||||
//lcl
|
||||
FPanningWindow.Free;
|
||||
CancelEditNode;
|
||||
|
||||
// Just in case it didn't happen already release the edit link.
|
||||
FEditLink := nil;
|
||||
@ -17496,6 +17497,7 @@ begin
|
||||
DeleteObject(FDottedBrush);
|
||||
FDottedBrush := 0;
|
||||
|
||||
CancelEditNode;
|
||||
inherited;
|
||||
{$ifdef DEBUG_VTV}Logger.ExitMethod([lcMessages],'DestroyHandle');{$endif}
|
||||
end;
|
||||
@ -18074,8 +18076,7 @@ begin
|
||||
DoStateChange([], [tsEditing]);
|
||||
if Assigned(FOnEditCancelled) then
|
||||
FOnEditCancelled(Self, FEditColumn);
|
||||
if not (csDestroying in ComponentState) then
|
||||
FEditLink := nil;
|
||||
FEditLink := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -30443,14 +30444,6 @@ end;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
procedure TVTEdit.CMRelease(var Message: TLMessage);
|
||||
|
||||
begin
|
||||
Free;
|
||||
end;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
procedure TVTEdit.CNCommand(var Message: TLMCommand);
|
||||
|
||||
begin
|
||||
@ -30467,6 +30460,13 @@ end;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
procedure TVTEdit.DoRelease(Data: PtrInt);
|
||||
begin
|
||||
Free;
|
||||
end;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
procedure TVTEdit.WMChar(var Message: TLMChar);
|
||||
|
||||
begin
|
||||
@ -30633,7 +30633,7 @@ procedure TVTEdit.Release;
|
||||
|
||||
begin
|
||||
if HandleAllocated then
|
||||
PostMessage(Handle, CM_RELEASE, 0, 0);
|
||||
Application.QueueAsyncCall(DoRelease, 0);
|
||||
end;
|
||||
|
||||
//----------------- TStringEditLink ------------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user