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>


To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. ----------------------------------------------------------
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