[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kopete-devel
Subject:    [Kopete-devel] Re: KopeteContact properties, first draft
From:       Richard Smith <kde () metafoo ! co ! uk>
Date:       2004-01-24 16:58:51
Message-ID: 200401241658.51646.kde () metafoo ! co ! uk
[Download RAW message or body]

On Saturday 24 January 2004 3:37 pm, Martijn Klingens wrote:
> On Wednesday 21 January 2004 23:37, Stefan Gehn wrote:
> > This stupid d pointer for KopeteContactProperty::null gets deleted after
> > first use (have to delete d in the destructor).
> > I vote for living without such a complicated d-pointer construct.
>
> Hmm, after looking at your diff I understand your problem. Next time use a
> simpler class for your D pointer 101 and not a class that supports special
> null objects :)
>
> If you want null objects you should either add a lot of safeguards in the D
> pointer handling, or add a separate isNull flag in the Private object or
> the main class. Alternatively you could add refCounting. Either of these
> will work, and neither of them is an easy beginner's case to code...

... or, use reference semantics for the class instead of value semantics. 
Easier for a beginner, but it means they've got to have a well-defined owner 
(not a bad thing tho).

Richard
_______________________________________________
Kopete-devel mailing list
Kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic