Since you're writing your own server app using the embedded server, we cannot see how you manage whatever comes in and out of the embedded server.
I don't see ATree being Free-d, and if it eventually is, no guarantee it will free its children recursively as well. I'd say compile with -glh and you will get a proper stacktrace. AResponse, if it comes as HTTPRouter route's parameter, will be handled outside your registered handler, so no need to free it manually (in fact, don't).The main section, who creates and free the elements of response is this. I thought that after the response it would clear itself. By the way, I really got to review my interpreter code.
AInter := TInterpreter.Create(ATree); AInter.Interpret; Output := AInter.PLive; //AInter.FreeInstances; AInter.Free; AParser.Free; ALexer.Free; AResponse.Content := Output; WriteLn(#13+'['+FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', Now)+'] ' + ARequest.Method + ': '+ ARequest.URI+' -- '+ IntToStr(AResponse.Code)+ ' ' + AResponse.CodeText + ', ' + IntToStr(AResponse.ContentLength) + ' B', #13);
In time: @leledumbo, I visited your GitHub and saw the template engineering and parsers seem to be a subject of your interest. Would you like to contribute at UltraGen project? I'm developing a brand new programming language specifically designed to create web pages. It can use plain and script text mixed like PHP but with modern approaches and strongly typed. Maybe you can find it interesting. Here is the linkI consider that one kind of shitty, as it was made with classic single person programming in mind. Nowadays we made frontend totally separate from backend, which is glued by HTTP contract.
https://github.com/alantelles/ultragen/tree/refactor
Greetings