Changeset 13939


Ignore:
Timestamp:
Feb 3, 2013, 12:31:44 PM (8 years ago)
Author:
jordan
Message:

(qt) plug a handful of minor memory leaks

Location:
trunk/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/filterbar.cc

    r13937 r13939  
    227227{
    228228  FilterBarComboBox * c = new FilterBarComboBox (this);
    229   FilterBarComboBoxDelegate * delegate = new FilterBarComboBoxDelegate (0, c);
     229  FilterBarComboBoxDelegate * delegate = new FilterBarComboBoxDelegate (this, c);
    230230  c->setItemDelegate (delegate);
    231231
     
    234234  QIcon blankIcon (blankPixmap);
    235235
    236   QStandardItemModel * model = new QStandardItemModel;
     236  QStandardItemModel * model = new QStandardItemModel (this);
    237237
    238238  QStandardItem * row = new QStandardItem (tr ("All"));
     
    393393{
    394394  FilterBarComboBox * c = new FilterBarComboBox (this);
    395   FilterBarComboBoxDelegate * delegate = new FilterBarComboBoxDelegate (0, c);
     395  FilterBarComboBoxDelegate * delegate = new FilterBarComboBoxDelegate (this, c);
    396396  c->setItemDelegate (delegate);
    397397
     
    427427  const int hmargin = qMax (int (HIG::PAD), style ()->pixelMetric (QStyle::PM_LayoutHorizontalSpacing));
    428428
    429   myCountLabel = new QLabel;
     429  myCountLabel = new QLabel (this);
    430430  h->setSpacing (0);
    431431  h->setContentsMargins (2, 2, 2, 2);
     
    437437  h->addSpacing (hmargin);
    438438
    439   myTrackerModel = new QStandardItemModel;
     439  myTrackerModel = new QStandardItemModel (this);
    440440  myTrackerCombo = createTrackerCombo (myTrackerModel);
    441441  h->addWidget (myTrackerCombo, 1);
     
    446446  connect (myLineEdit, SIGNAL (textChanged (QString)), this, SLOT (onTextChanged (QString)));
    447447
    448   QPushButton * p = new QPushButton;
     448  QPushButton * p = new QPushButton (this);
    449449  QIcon icon = QIcon::fromTheme ("edit-clear", style ()->standardIcon (QStyle::SP_DialogCloseButton));
    450450  int iconSize = style ()->pixelMetric (QStyle::PM_SmallIconSize);
  • trunk/qt/mainwin.cc

    r13928 r13939  
    233233  connect (myAltSpeedAction, SIGNAL (triggered ()), this, SLOT (toggleSpeedMode ()));
    234234
    235   QMenu * menu = new QMenu ();
     235  QMenu * menu = new QMenu (this);
    236236  menu->addAction (ui.action_OpenFile);
    237237  menu->addAction (ui.action_AddURL);
     
    430430    a->addAction (ui.action_SessionRatio);
    431431    a->addAction (ui.action_SessionTransfer);
    432     m = new QMenu ();
     432    m = new QMenu (this);
    433433    m->addAction (ui.action_TotalRatio);
    434434    m->addAction (ui.action_TotalTransfer);
     
    462462  stockRatios << 0.25 << 0.50 << 0.75 << 1 << 1.5 << 2 << 3;
    463463
    464   menu = new QMenu;
     464  menu = new QMenu (this);
    465465  sub = menu->addMenu (tr ("Limit Download Speed"));
    466466
     
    14581458  menu->addAction (ui.action_OpenFolder);
    14591459
    1460   QAction * sep = new QAction (this);
     1460  QAction * sep = new QAction (menu);
    14611461  sep->setSeparator (true);
    14621462  menu->addAction (sep);
     
    14711471  menu->addAction (ui.action_Pause);
    14721472
    1473   sep = new QAction (this);
     1473  sep = new QAction (menu);
    14741474  sep->setSeparator (true);
    14751475  menu->addAction (sep);
     
    14781478  menu->addAction (ui.action_CopyMagnetToClipboard);
    14791479
    1480   sep = new QAction (this);
     1480  sep = new QAction (menu);
    14811481  sep->setSeparator (true);
    14821482  menu->addAction (sep);
Note: See TracChangeset for help on using the changeset viewer.