Virtual-TreeView icon indicating copy to clipboard operation
Virtual-TreeView copied to clipboard

Access Violation if Themes have been changed

Open romankassebaum opened this issue 3 years ago • 1 comments

In applications that change their themes on the fly I get an access violation if the application is closed. The issue happens here:

unit VirtualTrees.StyleHooks;
...
finalization
  TCustomStyleEngine.UnRegisterStyleHook(TVirtualStringTree, TVclStyleScrollBarsHook);
  TCustomStyleEngine.UnRegisterStyleHook(TVirtualDrawTree, TVclStyleScrollBarsHook);

As a workaround I surrounded the UnRegisterStyleHook call with a try except block. Maybe there is something better.

romankassebaum avatar Aug 11 '22 23:08 romankassebaum

In the Advanced demo project I added the unit Vcl-Themes and a button with the code:

  if TStyleManager.ActiveStyle.IsSystemStyle  then
    TStyleManager.TrySetStyle('Glow')
  else
    TStyleManager.TrySetStyle('Windows');

I tried it on several pages and pressed this button multiple times, but no error occurred at program termination (RAD Studio 11.1, Windows 10). Please provide a sample project that allows to replicate the issue or a pull request that fixes the issue.

joachimmarder avatar Aug 13 '22 08:08 joachimmarder

No repro steps were provided in the past 4 months and no similar reports were received. Therefore, closing this issue.

joachimmarder avatar Dec 04 '22 10:12 joachimmarder