On Sun, 2002-11-10 at 12:08, Max Bowsher wrote: > Robert Collins <[EMAIL PROTECTED]> wrote: > > > Oh, and I've not updated the client code to use the new > > LogFile::createLogFile factory yet. That should be a one liner (for a > > heap allocated object) or two liner (for a member object) update. > > I've never really programmed any complicated inheritance, but why do we need > a factory instead of a constructor? > > You left in the declaration of LogFile::LogFile(), without a definition. I > added:
That was deliberate, to trap any accidental uses of it rather than
having a synthetic one created (not that a synthetic should exist when
any explicit constructors have been declared.
>
> LogFile::LogFile() : LogSingleton(new std::stringbuf)
> {
> }
>
> and that seems to work. No updates needed for the client code. Have I missed
> some subtle resource leak in doing this?
Yes. We need to set the static theStream to the stringbuf.
Rob
>
--
---
GPG key available at: http://users.bigpond.net.au/robertc/keys.txt.
---
signature.asc
Description: This is a digitally signed message part
