Recent CVS commits
Robert Collins
rbcollins@cygwin.com
Sat Nov 9 17:22:00 GMT 2002
On Sun, 2002-11-10 at 12:08, Max Bowsher wrote:
> Robert Collins <rbcollins@cygwin.com> 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.
---
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20021109/d19f25ac/attachment.sig>
More information about the Cygwin-apps
mailing list