Line 9 isn't deleting the object, it's deleting a REFERENCE to the
object.  The object is only dead when all references to it are gone.

cheers,
barneyb

On 9/26/05, John Samson <[EMAIL PROTECTED]> wrote:
>
>
> If CFCs are copied by reference [as the output at line 8 suggests] then how
> come I can still reference an object [line 10] once it has been deleted
> [line 9]? I would expect line 10 to throw an error but it doesn't, however,
> an attempt to reference session.nameObj at the same place does.
>
>
>
> Can anyone help me understand what I am seeing?
>
>
>
> 1. <cfapplication sessionmanagement = "true">
>
> 2. <cfset session.nameObj = createObject('component',
> 'nameComponent').init()>
>
> 3. <cfset session.nameObj.setName("Elaine")>
>
> 4. <cfoutput>
>
> 5. <cfset variables.namePointer = session.nameObj>
>
> 6. #variables.namePointer.getName()#<br>
>
> 7. <cfset session.nameObj.setName("Richard")>
>
> 8. #variables.namePointer.getName()#<br>
>
> 9. #structDelete(session, "nameObj")#
>
> 10. #variables.namePointer.getName()#<br>
>
> 11. </cfoutput>
>


--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to