mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-20 12:39:31 +02:00
LCL-Win32: Prevent AV due to message handling after freeing method pointer. Issue #39754, patch by DeerLab.
This commit is contained in:
parent
09584a03b9
commit
0096648e9c
@ -317,9 +317,7 @@ begin
|
||||
Here we get the callback WndMethod associated with this window
|
||||
------------------------------------------------------------------------------}
|
||||
PMethod := {%H-}Pointer(Widgetset.GetWindowLong(ahwnd, GWL_USERDATA));
|
||||
|
||||
if Assigned(PMethod) then PMethod^(Msg);
|
||||
|
||||
Windows.DefWindowProc(ahwnd, uMsg, wParam, lParam);
|
||||
end;
|
||||
|
||||
@ -469,7 +467,12 @@ begin
|
||||
|
||||
This memory is for the TMethod structure allocated on AllocateHWnd
|
||||
------------------------------------------------------------------------------}
|
||||
if Assigned(PMethod) then Freemem(PMethod);
|
||||
if Assigned(PMethod) then
|
||||
begin
|
||||
Freemem(PMethod);
|
||||
// remove the method pointer
|
||||
Self.SetWindowLong(Wnd, GWL_USERDATA, {%H-}PtrInt(nil));
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWin32WidgetSet.DestroyRubberBand(ARubberBand: HWND);
|
||||
|
Loading…
Reference in New Issue
Block a user