Valgrind hit in kio_data [PATCH]
George Staikos
staikos at kde.org
Thu Feb 24 23:55:04 GMT 2005
On Thursday 24 February 2005 18:43, Ingo Klöcker wrote:
> On Friday 25 February 2005 00:33, André Wöbbeking wrote:
> > On Friday 25 February 2005 00:24, Till Adam wrote:
> > > That one is typical of one of our biggest problems in KMail, the
> > > fact that message pointers can become invalid at any time.
> >
> > what about shared or guarded pointer?
>
> This would prevent crashes but lead to hard to track bugs, i.e. changes
> to the (dead) KMMsgInfo object would be lost because this object was
> already replaced by a KMMessage object. It's much easier to find the
> remaining problems when a crash occurs.
>
> As Till already wrote we will clean up this mess for KDE 4.
Or:
mMsg->die();
::die() {
_dead = true;
}
::setFoo() {
assert(!_dead);
...
}
Tedious, but it would give you shared pointers and alert of unexpected
changes.
--
George Staikos
KDE Developer http://www.kde.org/
Staikos Computing Services Inc. http://www.staikos.net/
More information about the kde-core-devel
mailing list