From kfm-devel Mon Oct 21 07:52:41 2002 From: David Faure Date: Mon, 21 Oct 2002 07:52:41 +0000 To: kfm-devel Subject: Re: java plugin in nspluginviewer X-MARC-Message: https://marc.info/?l=kfm-devel&m=103518690519222 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 21 October 2002 00:05, Till Krech wrote: > 5) I found a (in my eyes) weird problem. Look at this (kdebase/nsplugins): > In nsplugin.h: > class NSPluginStreamBase : public QObject > { > Q_OBJECT > ... > private: > -----> QByteArray _queue; > ... > } > > and in nsplugin.cpp: > NSPluginStreamBase::~NSPluginStreamBase() > { > if (_stream) { > _instance->NPDestroyStream( _stream, NPRES_USER_BREAK ); > delete _stream; > } > > delete _tempFile; > -----> delete _queue; > } > > _queue is not a pointer. What happens upon delete ? _queue is casted to a char*, since QMemArray provides such a conversion operator. Of course using _queue.data() would be far far cleaner and easier to understand. > Isn't _queue deleted automatically when NSPluginStreamBase is deleted? The QByteArray is. Its content, not, if setRawData was used. You need to check how the memory management of the contents of _queue is done. - -- David FAURE, david@mandrakesoft.com, faure@kde.org http://people.mandrakesoft.com/~david/ Contributing to: http://www.konqueror.org/, http://www.koffice.org/ Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9s7JJ72KcVAmwbhARAuS5AKCuttyLE4Po+n1RiP/yGNDpOXa+cwCeIK/k 2JtkGAp1OasQ0Rl56hb93L0= =avU5 -----END PGP SIGNATURE-----