Template:ComChannelMemoryUsageNote

From emotive
Revision as of 13:50, 22 October 2014 by Js (talk | contribs) (Created page with "{{Important| '''For long-time running procedures''': The OTX runtime will close open ComChannels solely via the CloseComChannel activity! The has an impact on the long-time st...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Exclamation.png Important: For long-time running procedures: The OTX runtime will close open ComChannels solely via the CloseComChannel activity! The has an impact on the long-time stability of the runtime environment. To avoid memory leaks, ComChannels should not be opened implicitly, like
ExecuteDiagService(CreateDiagServiceByName(GetComChannel("LL_AirbaUDS","",false), "DiagnServi_ReadDataByIdentECUIdent"), ...);

because the resources can be released only after completion of runtime execution. Better use:

ComChannel comChannel = GetComChannel("LL_AirbaUDS","",false);
DiagService diagService = CreateDiagServiceByName(comChannel, "DiagnServi_ReadDataByIdentECUIdent"));
ExecuteDiagService(diagService, ...);
...
CloseComChannel(comChannel);