Loading ...
Sorry, an error occurred while loading the content.

Calls to DESTROY when using objects_by_reference.

Expand Messages
  • francis_reader
    I have written a class service which has a lengthy file read and parse time when an instance of that class is created within the new method. I am using
    Message 1 of 1 , May 2, 2002
    • 0 Attachment
      I have written a class service which has a lengthy file read and
      parse time when an instance of that class is created within the new
      method.

      I am using soaplite on the client as well at the moment, just for
      testing until the service is finished (at that time it will be
      offered via WSDL to a windows VB client, created from MS Toolkit v2.0)

      When an object is created I can observe that new is called, however I
      can also see that the DESTROY method is called just after the new,
      and after each call to other methods.

      whether or not I am calling the object via reference or by value, the
      following occurs:

      In client

      $r=myclass->new("somearg");
      print $r->mymethod("foo");
      print $r->mymethod("bar");

      And logging on the server reports:
      Call to new
      Call to DESTROY
      Call to DESTROY
      Call to DESTROY

      (The last two DESTROYs only appear after Ctrl-C'ing the server,
      probably flushing the output buffer.)

      So why is DESTROY being called after each method call?
      BTW: The functionality of the method call appear to work, return sane
      value when I down clear down the object.
    Your message has been successfully submitted and would be delivered to recipients shortly.