Crash when creating a KHTMLView

David Faure faure at kde.org
Wed Aug 24 17:30:02 BST 2005


On Monday 15 August 2005 00:58, Andreas Kling wrote:
> On Friday 12 August 2005 13:52, Andreas Kling wrote:
> > On Thursday 11 August 2005 10.30, Andras Mantia wrote:
> > > As I saw ref/deref is done in the constructor destructor, so what about:
> > >
> > > KHTMLFactory *factory = new KHTMLFactory();
> > > accessKeysEnabled =
> > > KHTMLFactory::defaultHTMLSettings()->accessKeysEnabled();
> > > delete factory;
> >
> > That's all right, but something like:
> >
> > KHTMLSettings *settings = new KHTMLSettings();
> > accessKeysEnabled = settings->accessKeysEnabled();
> > delete settings;
> >
> > ...would create one less object. It still parses the configuration file
> > another time, though, which is pretty ugly.
> 
> Yeah okay, I was talking out of my socks here.
> Creating a new KHTMLFactory is way better than creating a new KHTMLSettings.
> Mr. Mantia had it right all along. Sorry ;-)

I don't see how. The ref/deref solution has the advantage that no factory needs to be
created at all, if there's already one. Can you apply the ref/deref solution instead,
if it works for you?

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kfm-devel mailing list