Skip to content

Creating a `TVirtualStringTree` from a DLL crash or not load the main program — UtilityImages resource is not initialized properly

  • Lazarus/FPC Version: Lazarus 2.2.0 (rev 65426) FPC 3.2.0 i386-win32-win32/win64
  • Operating System: Windows
  • CPU / Bitness: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz 2.81 GHz / 64Bit

What happens

I creates a TVirtualStringTree instance from a DLL, but it crash or not load the main program. The reason is how UtilityImages resource is initialized.

What did you expect

On this line https://gitlab.com/freepascal.org/lazarus/lazarus/-/blob/main/components/virtualtreeview/laz.virtualtrees.pas?expanded=true&viewer=simple#L5521 it should use TheInstance instead 0.

Steps to reproduce

Create a TVirtualStringTree from a DLL that a program uses, to see the program crash or not load.