W3C home > Mailing lists > Public > www-lib@w3.org > July to September 1999

HText_delete callback not called

From: Vaclav Barta <vbar@comp.cz>
Date: Sun, 08 Aug 1999 15:34:20 +0000
Message-ID: <37ADA37C.2FDD080D@comp.cz>
To: wwwlib <www-lib@w3.org>
Hi,

when I register HText creation and deletion callbacks with
HText_registerCDCallback, HText_new is called, but HText_delete
isn't. I looked into libwww sources and found that libwww never
calls through the pointer supplied to HText_registerCDCallback.
There's even a comment in HTextImp_delete:

	/*
	** Note that we do not call the delete method on the app
	** HText object as this normally stays around after the
	** request has been deleted and certainly it should be
	** deleted by the app and not libwww
	*/

This is wrong - if the application doesn't want to delete
HText, it can just supply NULL to HText_registerCDCallback
(and even if it does supply HText_delete, nobody forces
HText_delete to delete anything - it can decrease reference
count or whatever it wants). My app needs to delete HText as
soon as possible, and I don't know when to do it. HText
callbacks are confusing; IMHO they should be modeled after C++
(I'm a big fan of C++ :-) ):

1) HText_registerCreateCallback to register HText_new,
which should create the object (i. e. calling new);
HText_new is called first
2) HText_registerTextCallback, HText_registerLinkCallback
etc. as they are now; registered callbacks are called repeatedly
3) HText_registerBuildCallback to register HText_build,
which should finish text processing; HText_build is called before
HText_delete
4) HText_registerDeleteCallback to register HText_delete,
which should delete the object (i. e. calling delete);
HText_delete is called last

So, what do you think?

	Bye
		Vasek
--
I have a search engine, too!
http://www.locus.cz/locus/
Received on Monday, 9 August 1999 01:19:39 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:17 UTC