[Kde-pim] [patch] handling of static data in akonadi and mailtransport

Ingo Klöcker kloecker at kde.org
Tue May 20 18:44:32 BST 2008


On Tuesday 20 May 2008, Jaroslaw Staniek wrote:
> Tom Albers said the following, On 2008-05-20 09:50:
> > Op dinsdag 20 mei 2008 09:43 schreef u:
> >> Op dinsdag 20 mei 2008 09:17 schreef u:
> >>> I'd like to commit if that's acceptable - to save trouble for our
> >>> packagers.
> >>
> >> Since you haven't tested it, I will do it this evening for the
> >> socket.cpp change. Please do not commit until then.
> >>
> >> Toma
> >
> > Oh, I could not find the reason of the socket.cpp change. Can you
> > enlighten me why static is a bad idea?
>
> Because it's a static block of data in a shared library, not app. If
> you use K_GLOBAL_STATIC, you know you'll have one global instance
> with initialized members.
> See http://www.kdedevelopers.org/node/2889

Apart from this the static was shared by all instances of SocketPrivate. 
I don't think this is what was intended unless SocketPrivate was a 
singleton. But even if it was a singleton then one should still have 
used a member variable for buffering the incoming data.

IOW, unless I'm missing something then using a static local variable was 
plain wrong.


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20080520/8c690891/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list