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

List:       kfm-devel
Subject:    Re: java plugin in nspluginviewer
From:       David Faure <david () mandrakesoft ! com>
Date:       2002-10-21 7:52:41
[Download RAW message or body]

-----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<char> 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-----

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

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