Hi David,
David Bertoni <[EMAIL PROTECTED]> writes:
> The recent changes to MemoryManager.hpp break deriving classes.
That shouldn't be a problem since 3.0.0 is allowed to break
interfaces.
> - virtual MemoryManager* getExceptionMemoryManager() = 0;
> + virtual MemoryManager* getExceptionMemoryManager() { return this; }
>
> I realize this introduces some implementation into the MemoryManager
> class, but I think it's worth it for compatibility.
There is a more important drawback in doing this: the pure virtual
function forces users who implement their own memory managers to
pay attention and decide what to return from this function. In
fact, memory managers that are used locally should probably return
the global memory manager (XMLPlatformUtil::fgMemoryManager), not
'this'. Otherwise there is a good chance that the exception thrown
will outlive the memory manager which manages its guts. So I would
say we should keep it pure virtual.
Boris
--
Boris Kolpackov, Code Synthesis Tools
Open source XML data binding for C++: http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]