Hi,<br><br>I'd like to commit this to VTK now. I've put some commits on gerrit and I'm hoping some folks will have time this week to take a look. The commits are:<br><br><a href="http://review.source.kitware.com/#change,1654">http://review.source.kitware.com/#change,1654</a> <br>
<a href="http://review.source.kitware.com/#change,1655">http://review.source.kitware.com/#change,1655</a><br><a href="http://review.source.kitware.com/#change,1656">http://review.source.kitware.com/#change,1656</a><br><br>
-The first commit modifies vtkCommon. It adds required api to vtkDebugLeaks.<br>-The second commit modifies GuiSupport/Qt to add the widget and a test for the widget.<br>-The third commit may not pass review. It adds python powered features to the widget, but also adds a python dependency to the QVTK library. Project developers interested in using the widget can always subclass the widget to add the python features themselves.<br>
<br><br>In my opinion, the first commit is low risk for bugs and regressions. If it passes review, I hope it can be put into the 5.8 release. The second commit is also low risk because it simply adds a new stand-alone widget with test, it does not alter any existing code. If it passes with a green dashboard then I think it should also be placed in the 5.8 release.<br>
<br>Just a reminder, usage of this widget is detailed at: <a href="http://vtk.org/Wiki/DebugLeaksView" target="_blank">http://vtk.org/Wiki/DebugLeaksView</a><br><br>Pat<br><br><br><div class="gmail_quote">On Tue, Feb 15, 2011 at 12:59 PM, pat marion <span dir="ltr"><<a href="mailto:pat.marion@kitware.com">pat.marion@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I'd definitely be in favor of adding this widget to VTK master, but I'll leave that decision to the VTK community and ARB.<br>
<br>The code is mostly self contained in a pair of qt model/view classes, but also requires modifications to vtkObjectBase.cxx and vtkDebugLeaks{cxx,h} here:<br>
<br> <a href="https://github.com/patmarion/VTK/commit/8b3b7203323859efb493cd76d1d2ca68e22eff62" target="_blank">https://github.com/patmarion/VTK/commit/8b3b7203323859efb493cd76d1d2ca68e22eff62</a><br><br>The main change is that I added hooks to vtkObjectBase.cxx:<br>
<br>diff --git a/Common/vtkObjectBase.cxx b/Common/vtkObjectBase.cxx<br>index 9ea53ec..c75687b 100644<br>--- a/Common/vtkObjectBase.cxx<br>+++ b/Common/vtkObjectBase.cxx<br>@@ -75,10 +75,17 @@ vtkObjectBase::vtkObjectBase()<br>
{<br> this->ReferenceCount = 1;<br> this->WeakPointers = 0;<br>+#ifdef VTK_DEBUG_LEAKS<br>+ vtkDebugLeaks::ObjectConstructed(this);<br>+#endif<br> }<br> <br> vtkObjectBase::~vtkObjectBase() <br> {<br>+#ifdef VTK_DEBUG_LEAKS<br>
+ vtkDebugLeaks::ObjectDestroyed(this);<br>+#endif<br>+<br> // warn user if reference counting is on and the object is being referenced<br> // by another object<br> if ( this->ReferenceCount > 0)<br><br><br>
The vtkDebugLeaks::ObjectConstructed/ObjectDestroyed function calls are essentially no-ops unless the widget is activate. And of course when VTK_DEBUG_LEAKS is OFF then the whole thing is skipped. So I think it is pretty unobtrusive the way I have it, but perhaps someone will suggest an alternate implementation.<br>
<br>Note- class counts and reference counts are not updated instantaneously, they are updated when the application event loop cycles. For people interested in pinpointing instantaneous changes, gdb or other debugger is still the best option.<br>
<font color="#888888">
<br>Pat</font><div><div></div><div class="h5"><br><br><br><div class="gmail_quote">On Tue, Feb 15, 2011 at 11:28 AM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
This is fantastic. Really helpful visual debug tool. <div><br></div><div>Any plans to move it into VTK master? <br><div><br></div><div>Thanks Pat. <br><br><div class="gmail_quote"><div>On Sat, Feb 12, 2011 at 11:04 AM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span> wrote:<br>
</div><div><div></div><div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Absolutely brilliant. Nice work, Pat!<div><div></div>
<div><div><br><br><div class="gmail_quote">On Sat, Feb 12, 2011 at 10:57 AM, Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">That;s fantastic. Can't wait to try it out next time I am trying to<br>
debug a leak-hell.<br>
<br>
Utkarsh<br>
<div><div></div><div><br>
On Fri, Feb 11, 2011 at 5:49 PM, pat marion <<a href="mailto:pat.marion@kitware.com" target="_blank">pat.marion@kitware.com</a>> wrote:<br>
> Hello vtk and qt heads,<br>
><br>
> I've got a new widget to share with you. Actually it's not new. I wrote<br>
> the code several months ago when I was stuck in an airport. I finally got<br>
> around to rebasing it and pushing to github. I added a wiki page with<br>
> screenshots:<br>
><br>
> <a href="http://vtk.org/Wiki/DebugLeaksView" target="_blank">http://vtk.org/Wiki/DebugLeaksView</a><br>
><br>
> Motivation: VTK_DEBUG_LEAKS is a great help, any developer worth his or her<br>
> salt has it enabled... (right?) But it only reports leaky objects at<br>
> program shutdown. I wanted to spy on my vtk objects at runtime. So I<br>
> created this debug leaks widget. Please see the wiki page for a<br>
> demonstration!<br>
><br>
> Pat<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
><br>
><br>
><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div></div></div><br><br clear="all"><br>-- <br><font color="#888888">| Aashish Chaudhary <br></font><div>| R&D Engineer <br>| Kitware Inc. <br>| <a href="http://www.kitware.com" target="_blank">www.kitware.com</a> <br>
</div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br>