<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/121362/">https://git.reviewboard.kde.org/r/121362/</a>
     </td>
    </tr>
   </table>
   <br />











<div>



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/121362/diff/5/?file=332087#file332087line41" style="color: black; font-weight: bold; text-decoration: underline;">src/lib/marble/GeoGraphicsScene.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 5)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool zValueLessThan( GeoGraphicsItem* i1, GeoGraphicsItem* i2 )</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">41</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">foreach</span><span class="p">(</span><span class="k">const</span> <span class="n">QList</span><span class="o"><</span><span class="n">GeoGraphicsItem</span><span class="o">*></span> <span class="o">&</span><span class="n">list</span><span class="p">,</span> <span class="n">m_items</span><span class="p">.</span><span class="n">values</span><span class="p">())</span> <span class="p">{</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I'd rather call clear(), see below</p></pre>
 </div>
</div>
<br />

<div>



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/121362/diff/5/?file=332087#file332087line250" style="color: black; font-weight: bold; text-decoration: underline;">src/lib/marble/GeoGraphicsScene.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 5)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void GeoGraphicsScene::removeItem( const GeoDataFeature* feature )</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">250</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">qDeleteAll</span><span class="p">(</span><span class="n">list</span><span class="p">);</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This is not complete as m_features has references to m_items subparts still.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I'd suggest a different approach:
- Merge the functionality of the existing GeoGraphicsScene::eraseAll() into GeoGraphicsScene::clear() and remove GeoGraphicsScene::eraseAll() in favor of that method
- move the clear() implementation into the private class and also call it from its destructor</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This minimizes code duplication and makes sure to clean up consistently. Also gets rid of the wrong doxygen comments of eraseAll.</p></pre>
 </div>
</div>
<br />

<div>



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/121362/diff/5/?file=332088#file332088line124" style="color: black; font-weight: bold; text-decoration: underline;">src/lib/marble/MarbleModel.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 5)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">class MarbleModelPrivate</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">124</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">delete</span> <span class="n">m_legend</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Good catch, but the fix does not look complete to me. Can you please also do</p>
<ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">in MarbleModel::setLegend(), delete any previously set legend</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">in MarbleModel.h add a doxygen comments to setLegend() that says that MarbleModel takes ownership of the passed instance</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">in MarbleLegendBrowser.cpp fix the handling of m_isLegendLoaded. Move the checks for it inside loadLegend(): At the start of the method check whether the legend was loaded already by querying m_isLegendLoaded. If true, return. Otherwise, set m_isLegendLoaded to true (that is nowhere done currently) and actually load it.</li>
</ul>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Please also check for potential regressions (is the legend still loaded correctly afterwards on theme changes?)</p></pre>
 </div>
</div>
<br />



<p>- Dennis Nienhüser</p>


<br />
<p>On December 6th, 2014, 9:04 p.m. UTC, Illya Kovalevskyy wrote:</p>









<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for Marble, Dennis Nienhüser and Torsten Rahn.</div>
<div>By Illya Kovalevskyy.</div>


<p style="color: grey;"><i>Updated Dec. 6, 2014, 9:04 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
marble
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Related GCI-2014 task: http://www.google-melange.com/gci/task/view/google/gci2014/5790648552652800</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Valgrind detected a memory leak for approx 2k bytes in GeometryLayerPrivate::createGraphicsItemFromGeometry() function. That method adds newly created GeoGraphicsItem to the GeoGraphicsScene instance, which doesn't take care of newly created object. I tweaked code a bit so it cleans all items added.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Leak has been neutralized.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Double valgrind-check (inb4 the fix and after)</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/lib/marble/GeoGraphicsScene.cpp <span style="color: grey">(390d868)</span></li>

 <li>src/lib/marble/MarbleModel.cpp <span style="color: grey">(c71c9cc)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/121362/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>








  </div>
 </body>
</html>