NetTalk Central

Author Topic: Webserver: "cleanup code sequence" does this sequence matter?  (Read 231 times)

AtoB

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
    • Email
Webserver: "cleanup code sequence" does this sequence matter?
« on: August 20, 2026, 04:57:00 AM »
Hi All,

by accident I discovered that sometimes in the Webserver procedure, the following code (generated in legacy in: "before closing window"), has the following order

      s_web.iSession.Save()
    ThisWebserver.Kill()                              ! Generated by NetTalk Extension

but sometimes these lines are generated like this:

    ThisWebserver.Kill()                              ! Generated by NetTalk Extension
      s_web.iSession.Save()

I really don't know wether this is a problem or not (I didn't notice anything weird ...), but I think that for legacy this is cause by the following template code snippets that use the same priority() (see "nettalk.tpl"):

#AT(%BeforeWindowClosing),Priority(4500)
  #If((%NoNetTalk=0) and (%NoThisObj=0) and (%Family='cw20'))
%ThisObjectName.Kill()                      ! Generated by NetTalk Extension
  #EndIf
#ENDAT

#AT(%BeforeWindowClosing),Priority(4500)
  #If(%NoNetTalk=0 and %NoThisObj=0 and (%ABCBaseClass='NetWebServer' or sub(%ABCBaseClass,1,13)='NetWebServer_') and %Family='cw20')
    #IF(%FirstWebServer=%ActiveTemplateInstance)
#Insert(%ServerStateKillStuff)
    #endIf
  #EndIf
#ENDAT

Regards,
Ton