VIRTUAL_VMT_COUNT limit exceeded / insufficient memory size allocated by RegisterWSComponent
Original Reporter info from Mantis: Bartek Dajewski
-
Reporter name: Bartek Dajewski
Original Reporter info from Mantis: Bartek Dajewski
- Reporter name: Bartek Dajewski
Description:
Hello,
RegisterWSComponent allocates fixed size memory for any class, regardless of its VMT size. There is const value VIRTUAL_VMT_COUNT = 128, which is not enough if any widgetset class has more virtual methods. For example latest version of http://wiki.freepascal.org/lzRichEdit has 130 VMT entries, so last two of them (SetSelText and SetZoomState) cannot be used because of the SIGSEGV exception.
Steps to reproduce:
Set the SelText or ZoomState property of the RichBox component.
Program stops with SIGSEGV / Access violation exception.
Additional information:
Attached patch replaces constant values used by RegisterWSComponent with variables and determines correct VMT size of each registered class.
I've also had to make slight modifications to lzRichEdit source for testing because of compilation errors. I'll try to attach these changes as another attachment.