This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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. ---
Attachment:
signature.asc
Description: This is a digitally signed message part
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |