[Uml-devel] branches/work/isi-umbrello/umbrello/umbrello

Kevin Ottens ervin at kde.org
Fri Mar 2 16:07:22 UTC 2007


Le vendredi 2 mars 2007, Thomas Gallinari a écrit :
> SVN commit 638592 by gallinari:
>
> Using QList instead of List in combinedfragmentwidget.h and
> combinedfragmentwidget.cpp.
>
>
>  M  +6 -7      combinedfragmentwidget.cpp
>  M  +2 -2      combinedfragmentwidget.h
>
>
> --- branches/work/isi-umbrello/umbrello/umbrello/combinedfragmentwidget.cpp
> #638591:638592 @@ -116,7 +116,7 @@
>                  p.drawText(offsetX + COMBINED_FRAGMENT_MARGIN, offsetY ,
>  			w - COMBINED_FRAGMENT_MARGIN * 2, fontHeight, Qt::AlignLeft, "alt");
>                  // dash lines
> -                for(list<FloatingDashLineWidget*>::iterator
> it=m_dashLines->begin() ; it!=m_dashLines->end() ; it++) { +               
> for(QList<FloatingDashLineWidget*>::iterator it=m_dashLines->begin() ;
> it!=m_dashLines->end() ; it++) { (*it)->setX(getX());

Use "++it" instead of "it++".

>                      old_Y = (*it)->getYMin();
>                      (*it)->setYMin(getY());
> @@ -131,7 +131,7 @@
>                  p.drawText(offsetX + COMBINED_FRAGMENT_MARGIN, offsetY ,
>  			w - COMBINED_FRAGMENT_MARGIN * 2, fontHeight, Qt::AlignLeft,
> "parallel"); // dash lines
> -                for(list<FloatingDashLineWidget*>::iterator
> it=m_dashLines->begin() ; it!=m_dashLines->end() ; it++) { +               
> for(QList<FloatingDashLineWidget*>::iterator it=m_dashLines->begin() ;
> it!=m_dashLines->end() ; it++) { (*it)->setX(getX());

Same here.

>                      old_Y = (*it)->getYMin();
>                      (*it)->setYMin(getY());
> @@ -181,7 +181,7 @@
>      // creates a dash line if the combined fragment type is alternative or
> parallel if(m_CombinedFragment == Alt || m_CombinedFragment == Par)
>      {
> -        m_dashLines = new list<FloatingDashLineWidget*>();
> +        m_dashLines = new QList<FloatingDashLineWidget*>();
>          m_dashLines->push_back(new FloatingDashLineWidget(m_pView));

That definitely looks like leaked memory. You never delete this list AFAIK.
I advise you to avoid declaring it as pointed in the class. And to delete the 
FloatingDashLineWidget it contains in the CombinedFragmentWidget dtor.

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20070302/a85ede93/attachment.sig>


More information about the umbrello-devel mailing list