octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47372] Memory leaks and segmentation faults i


From: Dan Sebald
Subject: [Octave-bug-tracker] [bug #47372] Memory leaks and segmentation faults in Octave
Date: Wed, 13 Apr 2016 02:09:46 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15

Follow-up Comment #118, bug #47372 (project octave):

Good catch on the leaked QStringListModel.  I thought that the QListView acted
as a container class, but the documentation clearly states that isn't
necessarily so (because the design allows for multiple views to display a
particular model).  The Qt documentation also states:

"The view does not take ownership of the model unless it is the model's parent
object because the model may be shared between many different views."

So maybe the following would have worked too:


   QListView *view = new QListView;
   QAbstractItemModel *model = new QStringListModel (list, view);
   view->setModel (model);


http://doc.qt.io/qt-4.8/objecttrees.html
http://doc.qt.io/qt-5/qstringlistmodel.html


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47372>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]