Question : webservice.htc memory leak quick fix

Hi,
i've read in numerous articles now that the webservice.htc has a memory leak. In the future at my company, we will be rewriting the code not to depend on behaviors, but for the time allocated now, we are looking for a quick fix. Everytime a user goes to a page using the webserivce.htc, the wp process will increase by a few megs until eventually throughout the day, the process needs restarted.

my question is, is there some kind of call i can make to de-allocate the memory the webservice.htc is using once the page url changes or after the webserice.htc is done? i'll attach my code snipped so you can see how we are implementing it now.

i tried using
myPBehaviorID = document.all.service.addBehavior("/CommonFiles/webservice.htc"); and    document.all.service.removeBehavior(myPBehaviorID);

instead of this -
>

but it still has the memory leak.

thanks
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
---------------------------- function LookUpRequestComments(tr, intCall) { var svc = document.getElementById("service"); if (svc) {// the web service div was found - perform the validation if (svc.svcCRSMaintenance) { var intNum = GetRequestNumber(tr); // call the web service, passing the table row as an extra argument so the callback function // can access it as this.args[3] svc.svcCRSMaintenance.callService(GetRequestComments, "DMSGetRequestComments", intNum, tr); } } } function GetRequestComments(result) {// handles the result of the payment and business type validation call // returning a string error message if (!result.error) {// an error var strComments = result.value; if (strComments.length == 0) { strComments = "This request does not have any comments."; } } else {// an error occurred strComments = "The comments could not be retrieved."; } // assign the comments to the table row that was passed as the extra argument this.args[3].title = strComments; }

Answer : webservice.htc memory leak quick fix

we have decided to go ahead with implementing xmlhttp request instead of using the outdated webservice.htc. thank you for all your help on this though.

- Alan
Random Solutions  
 
programming4us programming4us