ReleaseInt

[Top]  [Chapter]  [Previous]  [Next]

This method (it is exclusive to the .NET assembly) releases a reference to some of the programming interface which was retrieved from TextDynamic.

 

It is necessary to use this method at the end of the methods which use an interface to make sure the garbage collection frees the interface at once.

 

Background: Some interfaces modify live objects inside the text. This can be paragraph of number styles, text layers or image objects. Those objects can be freed while the text is edited. So it is important to release any connection to the object as soon as possible, this is what ReleaseInt does.

 

It is  required to call ReleaseInt for the interfaces:

 

IWPDataBlock, retrieved by Memo.BlockAdd, BlockAppend and BlockFind

IWPNumberStyle, retrieved by Memo.GetNumberStyle

IWPTextObj, retrieved by TextCursor.CPOpenObj

IWPParInterface, retrieved by IWPDataBlock.CurrPar

IWPAttrInterface, retrieved by IWPDataBlock.CurrParAttr

 

It is not required to call it for IWPEditor, IWPMemo, IWPTextCursor and any interfaces which are passed as event parameters since they are automatically. released. It is also not required for CurrAttr, TextAttr, CurSelAttr etc. The new .NET dlls automatically make sure such buffered interfaces are not freed.


[releaseint.htm]    Copyright © 2007 by WPCubed GmbH