当用完了对象,应该调用这个实例的Free ( )方法来释放它。Free ( )首先进行检查保证这个对象实例不为Nil,然后它调用对象的析构方法Destroy( )。就是说,如果对象已经为空,调用free肯定不会有问题,调用Destroy就不能保证不出问题了。 release在线程处理中才会用, 比如:对TSynchroObject.Release(procedure Release; virtual;), Provides the interface for a method to release the synchronization object for use by other threads.
但却调用 FREE
就是多态了
release在线程处理中才会用,
比如:对TSynchroObject.Release(procedure Release; virtual;),
Provides the interface for a method to release the synchronization object for use by other threads.