Hi all!
I wonder if someone of you knows how are returned objects in a property or a function.
For example i've got a function caller:
VB Code:
dim a as new object a = getObjectA()
and a function:
VB Code:
Public function getObjectA as object try dim objReturn as new Object return objReturn catch ex as exception finally objReturn = nothing end try End sub
I would like to know:
Will the function return a copy of the object or a reference?
Will the line 'objReturn = nothing' destroy returned object ?
How can i be safe when disposing an object?
In the past, I have got many problems because i didn't dispose objects and now that i want to dispose them, im stuck with "Object disposed" errors.
Is there someone who can help me?
Regards
Pat




Reply With Quote