iNTERFACEWARE Products Manual > Installing and Using Chameleon > Language API Documentation > C# .NET Support > Garbage Collection Issues > Generating Messages |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
No problem as long as no exceptions are thrown. When generating messages, the GenerateMessage method will call Dispose() on the underlying table. As a consequence, it results in an error if you try and call GenerateMessage twice on the same message object. The only thing you need to be aware of is that if an exception is thrown in the code you use to populate the message object, there is a small risk that the it will not be called. This can be avoided by explicitly putting a try...finally block to ensure that the Dispose() method is called. For the most part the Runtime will invoke the Finalize() method, which will fix the situation. Most of the time you will not have to worry about this issue since having an exception thrown in your message generation code is usually an indication of a bug in your own code that you need to fix. |