Announcement

Collapse
No announcement yet.

Q on delete?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Q on delete?

    The efs docs say not to delete an object declared with var;

    var o = new MyObj(...);
    delete o; // don't do this

    My question is, what if I later assign the variable a new object;

    var o = new MyObj(...);
    [snip]
    o = new MyObj(...);

    Is this a leak? Is this supported? Should I not do this?

    Is it even possible to have memory leaks or not? Does the garbage collector handle it?

    Once in a while eSignal crashes and I'm wondering whether I'm performing some ill fated operations in my .efs script.

    Thanks,
    Mike

  • #2
    Re: Q on delete?

    Hello Mike,

    Originally posted by michaelmakuch
    The efs docs say not to delete of an object declared with var;

    var o = new MyObj(...);
    delete o; // don't do this

    My question is, what if I later assign the variable a new object;

    var o = new MyObj(...);
    [snip]
    o = new MyObj(...);

    Is this a leak? Is this supported? Should I not do this?
    You should be able to reassign the variable to a new instance an object. I have not heard of this type of routine causing a leak.

    Is it even possible to have memory leaks or not?
    Probably, but I'm not sure I've seen one yet.

    Does the garbage collector handle it?
    Not sure. It's possible that it might not.

    Once in a while eSignal crashes and I'm wondering whether I'm performing some ill fated operations in my .efs script.

    Thanks,
    Mike
    If you can post an example formula that consistently causes the crash I'll investigate further.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X