[prev in list] [next in list] [prev in thread] [next in thread]
List: kmail-devel
Subject: Serial number-related trouble, again
From: David Faure <dfaure () klaralvdalens-datakonsult ! se>
Date: 2005-05-26 13:56:00
Message-ID: 200505261556.03088.dfaure () klaralvdalens-datakonsult ! se
[Download RAW message or body]
This bug is about KMMessage::isComplete() returning false for a cached imap message (!!).
This happens after opening the separate reader window on a message and closing it.
(https://intevation.de/roundup/kolab/issue757)
kmmainwidget.cpp says:
2007 KMReaderMainWin *win = new KMReaderMainWin( mFolderHtmlPref );
2008 KMMessage *newMessage = new KMMessage(*msg);
2012 win->showMsg( mCodec, newMessage );
(make a copy of message and show it in KMReaderMainWin)
The first and second [but not the third ????] KMReaderMainWin constructors set
mReaderWin->setAutoDelete( true );
So KMReaderMainWin is in charge of the deletion of this "copy" KMMessage, no problem.
The bug is:
KMMsgBase::~KMMsgBase()
{
MessageProperty::forget( this );
}
which calls
void MessageProperty::forget( const KMMsgBase *msgBase )
{
Q_UINT32 serNum = serialCache( msgBase );
if (serNum) {
sCompletes.remove( serNum );
...
This makes the MessageProperty forget that this message is complete.
If it's allowed to make copies of messages, then deleting a copy shouldn't
make kmail forget about the properties associated with its serial number -
there can be other copies of the KMMessage/KMMsgBase which needs them!
Either we need to refcount the kmmessage copies (ouch), or we need to forbid making
copies (double ouch), or we need to simply forget about forgetting :)
i.e. what about removing the forget(this) call from the KMMsgBase destructor?
Which problems can we get if we keep information about a deleted message
(associated with a now-unused serial number?). Other than the minor memory
consumption, I think this should be OK, right?
--
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions
_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic