Applies To:
  • CitectSCADA 5.40

Summary:
I have discovered a memory leak in Citect runtime and have narrowed the problem down to a cicode function that uses VBCall functions to run CitectVBA code. 

Solution:
Carefully structuring your code can slow or eliminate memory leaks associated with calling CitectVBA code. Keep in mind a few rules:

1. Do not call the VBCallOpen() function from within a While loop. Either call VBCallOpen() before the While loop, or create a separate function for the VBCall functions and call this function from within the While loop.

2. Never write empty CitectVBA functions. Always have at least a few lines of code within your CitectVBA function. Take this approach for While loops in CitectVBA as well - do not leave them empty.

3. If you are using handles to ActiveX objects, then try to destroy/release them when finished wherever possible.

 

Keywords:
 

Attachments