G120 output port

Hello,

We have an customer designed board based on G120 module. The board run well in general but the output port changed the state (from true to false) every time when GC run. The GC run every 6-7 minutes. The same issue occurred on multiple boards. We have eliminated the possibility that the port was changed by Write (or Close) method from the code itself. We are also sure that there was no constructor code “new output port” involved during GC running. Any help would be much appreciated.

Thanks in advance,
Larry240

@ larry240 - sounds like the OutputPort object is going out of scope, and at a later time getting GC and disposed.

Where is the outputport declared? Is it a global variable in a class?

[Issue Solved]

Thank you all very much for pointing the right direction.

The output port is declared in a class and the class implements IDisposable interface. After removing the Dispose call, the system run over 15 hours and the output port stay with no changes. It seems like always better to let GC to release any unused resource like output port, etc instead of implementing the IDisposable interface manually in the embedded world.

Again, thanks for the help. Much appreciated. You guys are great.