It doesn't fix all cases. Take a look at gScannerMutex() in
src/internal/XMLScanner.cpp: it allocates some memory, for which it
registers and XMLDeleterFor, but it also sets a flag indicating that the
memory was registered. There's no mechanism for resetting the flag, so the
flag is set wrong once the memory gets released.
Rather than registering XMLDeleterFor objects, I think we need to register
static cleanup functions. It's a more general mechanism; such functions can
undo *any* changes to global data, whether it's releasing memory (and
setting corresponding pointers to null), setting or clearing flags, or
something else. I got a favorable response when I proposed the idea, but I
haven't found the time in the last year (!) to implement it. See the
http://marc.theaimsgroup.com/?l=xerces-c-dev&m=86952115511528&w=2 for
details. I think the problem is worth solving, if only to avoid the constant
stream of messages on the topic.
Here's what I'd propose:
1) Find out if anyone wants to give this approach a shot.
2) If so, call for a vote on the idea.
3) Implementer gives it a go. I'd be happy to consult, though I'm way
down-level, so I may not be much use on specifics.
4) If it works out, commit it.
This all assumes that nobody has a better idea. So far, I don't think I've
seen one.
-jesse-
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 06, 2001 12:20 AM
To: [EMAIL PROTECTED]
Subject: Problem initializing and terminating XMLPlatformUtils
I have a need to initialize and terminate the utilities multiple time for a
single process.
For each lazily initialized data (or Singleton) we register an object that
will perfom its cleanup (XMLDeleterFor<type>). It seems to me that if we
modified the XMLDeleterFor<type> to not only delete the pointer but also set
it to NULL this problem goes away.
Is there a problem with doing this?
Thanks,
-Chris.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]