AV in some controls when showing (with fix proposal)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35752
    wesson
    Participant

    There is a potential bug in TAcStatusBarWnd.AcWndProc leading to an access violation.

    When the message is CM_RECREATEWND, after calling the inherited message procedure, SkinData is no longer available (freed), so any attempt to read SkinData.Skinned result in an access violation.

    It's currently catched by a try .. except block , but it is very ugly – and may corrupt memory.

    So, here is a proposal, checking first which message, and then SkinData property

    File acSBUtils.pas, line 9975

    Replace this portion

    Code:
    – if (SkinData <> nil) and SkinData.Skinned then case Message.Msg of
    – WM_SIZE : begin
    – RedrawWindow(CtrlHandle, nil, 0, RDW_INVALIDATE or RDW_ERASE);
    – Exit;
    – end;
    – end;

    by this portion

    Code:
    + if (Message.Msg = WM_SIZE) and (SkinData <> nil) and SkinData.Skinned then begin
    + RedrawWindow(CtrlHandle, nil, 0, RDW_INVALIDATE or RDW_ERASE);
    + end;
    #50566
    Support
    Keymaster

    Thank you for the message, this code will be changed in the v8.35

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.