W3C home > Mailing lists > Public > www-lib@w3.org > April to June 2000

multiple calls to the request termination function cause crash

From: <jonah_lin@nysunburst.com>
Date: Thu, 8 Jun 2000 16:29:11 -0400
To: www-lib@w3.org
Message-ID: <852568F8.00708997.00@sunbny1.hmco.com>


  I have a C++ class that encapsulates the HTML parser (well, more or less
showtext.c). The thing is, the first time the parser gets called, everything
works fine (a new request get generates, and properly deleted in the termination
function).  However, the 2nd and consequent times it is called, my request
termination function gets called twice. The first time it properly deletes the
request object. The 2nd time it passes in the same request pointer, which of
course now points to garbage, and consequently crashes in HTRequest_delete()
(specifically when it tries to free orig_output_stream).

Does anyone know why the termination function is getting called twice?
Also, this problem looks similar to the problem Will Sargent had last year (msg
#1503,1505 in the archive), but there were no real answer to his problem.
Currently, I have a workaround to ignore the pointer when it comes around the
2nd time, but I prefer a more permanent solution.

Any help would be greatly appreciated..
-Jonah
Received on Thursday, 8 June 2000 16:36:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:36 GMT