Free - Deallocate the memory previously allocated for the object
nil - Dereference the object
When an object is created like
Query1 := TQuery.Create(nil)
It creates the instance and allocate some memory space to hold the data of Query1
When Free is called - It frees the memory of space already allocated for Query1
When nil is called - It sets the pointer to nil
Always try to use FreeAndNil instead of Free And Nil separately
No comments:
Post a Comment