Skip to content

Clone references #20

@rafacallejo

Description

@rafacallejo

I have and object like that:

Person (string Name, Person subp1, Person subp2)

If i create

P1=new Person ("p1",null,null)

and then

P2= new ("p2",P1,P1)

and i clone this P2 object as P3, its very strange but first child subp1 creates a new object but subp2 gets linked to the original.

P3.subp1 memory address is different of P2.subp1 "BUT" P3.subp2 and P2.subp2 have the same memory address, so any changes on the subp2 original gets replicated on the cloned instance and viceversa.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions