Closed craigmox closed 3 hours ago
Ah. Good spot and great suggestion.
fix is on dev branch and will be pushed next week
Just wanted to check - where you testing with Template.Eval() methods, or via the template registry methods?
I'll add some more multithreaded tests.
I've been load testing one of our web services that funnels through the class function Template.Parse(const AContext: ITemplateContext; const AStream: TStream; const AManagedStream: boolean = true): ITemplate
overload.
I've found that usage of a class instance of
TRegEx
inSempare.Template.Lexer.pas
is not thread-safe and is causing memory corruption issues in my testing:https://github.com/sempare/sempare-delphi-template-engine/blob/2bbdf4c158d5cfe6b2d03cc50991cff703368918/src/Sempare.Template.Lexer.pas#L272
This is due to the implementation of
IsMatch
unfortunately using a field to store the input text:I've found that
System.SysUtils.IsValidIdent
is a suitable replacement and has been working in my testing, just as one suggestion.Thanks!