Q: How to delete a QStrList ?

Martin Piskernig martin.piskernig at stuwo.at
Tue Feb 15 20:45:05 GMT 2000


On Tue, 15 Feb 2000, you wrote:
> Hi,
> Can anyone help me for this problem ?
> I have this code:
> QStrList strlist = new QStrList();

Did you omit the *?
QStrList* strlist = new QStrList();
but anyway...

> // do something
> delete strlist;
> Than the compiler says no pointer to delete .
> How can I delete the list ?

If it's not really necessary to have a strlist pointer, you should make
a QStrList strlist; which is deleted anyway after destructing the program.
(if you have a look at the QList usage (and QStrList is a QList<char*>)
in the Qt Documentation you will see what I mean.)
-- 
Martin Piskernig
<mpiskernig at kdevelop.de>       ICQ: 24015591
The KDevelop Team           www.kdevelop.org




More information about the KDevelop mailing list