Access Violation in TMSFNCDataGrid

Access Violation in TMSFNCDataGrid

Description

An Access Violation occurs when hovering the mouse over a `TMSFNCDataGrid` immediately after returning from another form that has been destroyed.

Steps to Reproduce

1. Click on the "ShowForm3" button.

2. Place Form3 in front of the `TTMSFNCDataGrid` to maximize the chances of reproducing the issue.

3. Click on "Close".

Annotations

This Access Violation is more reproducible in lower performance applications using the debugger helps lowering the performance.

When calling Application->CancelHint(), the bug does not appear.

Environment

  • IDE & Version: C++ builder 13

  • Operating System: Windows 11 pro

  • TMS Component Version: TMS FNC UI Pack v7.1.0.2

  • Framework: FMX

## Code Sample

`std::unique_ptr Unit3 =  std::make_unique(this);

Unit3->ShowModal();

Error Message

Project AvTMSfncDataGrid.exe raised exception class 0xc0000005 with message 'Access violation reading location 0xffffffffffffffff'.

Stack Trace

:00007FF643C8AF6F Fmx::Forms::TApplication::HideHint()()

:00007FF643C8AF29 Fmx::Forms::TApplication::CancelHint()()

:00007FF6440788BB System::Generics::Defaults::TDelegatedEqualityComparer__1Fmx::Tmsfncdatagridcell::TTMSFNCDataGridCellControlWrapper\*::TDelegatedEqualityComparer__1(System::DelphiInterface<System::Generics::Defaults::TEqualityComparison__1Fmx::Tmsfncdatagridcell::TTMSFNCDataGridCellControlWrapper\*>, System::DelphiInterface<System::Generics::Defaults::THasher__1Fmx::Tmsfncdatagridcell::TTMSFNCDataGridCellControlWrapper\*>)()

:00007FF644051639 Fmx::Tmsfncdatagridrenderer::TTMSFNCDataGridRenderer::HandleMouse(Fmx::Tmsfncdatagridcell::TTMSFNCDataGridMouseInfo&)()

:00007FF643D07A42 Fmx::Tmsfncdatagrid::TTMSFNCCustomDataGrid::HandleMouseMove(System::Set<System::Classes::TShiftStateItem, (System::Classes::TShiftStateItem)0, (System::Classes::TShiftStateItem)10>, float, float)()

:00007FF6440898BC Fmx::Tmsfnccustomcontrol::TTMSFNCCustomControlBase::MouseMove(System::Set<System::Classes::TShiftStateItem, (System::Classes::TShiftStateItem)0, (System::Classes::TShiftStateItem)10>, float, float)()

:00007FF643C9197C Fmx::Forms::TCommonCustomForm::MouseMove(System::Set<System::Classes::TShiftStateItem, (System::Classes::TShiftStateItem)0, (System::Classes::TShiftStateItem)10>, float, float)()

:00007FF64418A76C System::Generics::Defaults::TDelegatedEqualityComparer__1Fmx::Platform::Win::TImmManager\*::TDelegatedEqualityComparer__1(System::DelphiInterface<System::Generics::Defaults::TEqualityComparison__1Fmx::Platform::Win::TImmManager\*>, System::DelphiInterface<System::Generics::Defaults::THasher__1Fmx::Platform::Win::TImmManager\*>)()

:00007FF977F17846 CallWindowProcW()

:00007FF977F1730C CallWindowProcW()

Images

When the AV appers it shows this message:

![AVOnApp](image.png)

The embarcadero environment looks like this:

![C++ builder 13](image-1.png)

Project use for testing

AVTMSfncDataGrid.zip (12.7 KB)

we’ll investigate the access violation, please note in release mode the access violation does not occur can you confirm this?

In release mode is less likely to occur but it does occur.