Looks to me like this call...<br> // Now that we are about to begin the standard Cocoa event loop, we can get<br> // rid of the 'pool of last resort' because [NSApp run] will create a new<br> // pool for every event<br>
#ifndef __OBJC_GC__<br> gEarlyCocoaSetup->DestroyPoolOfLastResort();<br> #endif<br><br>...should be moved up to just before the lines that read:<br> // Start the NSApplication's run loop<br> [NSApp run];<br><br>
...they used to be in exactly that order prior to revision 1.15 of that file.<br><br>Unfortunately, that also means it looks like moving the entire vtkEarlyCocoaSetup class above the ObjectiveC class implementations to factilitate that call.<br>
<br>I've modified the file to see if it works for you. I will send it to you separately as an attached file. Let me know if it works for you and I will commit it to VTK after you let me know...<br><br><br>Thanks, (and hope this helps!)<br>
David Cole<br>Kitware, Inc.<br><br><br><div><span class="gmail_quote">On 2/23/08, <b class="gmail_sendername">Corrie Allen</b> <<a href="mailto:corrieallen@gmail.com">corrieallen@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">Hi David & VTKers,<div>At the time my program runs, __OBJC_GC__ is undefined and I can't find anywhere in my project, the VTK build, or my environment setting where it is either defined (or undefined). So, if the definition isn't hiding away somewhere, my understanding of it is that the PoolOfLastResort "hack" should be setting up a pool that can be subsequently autoreleased during Cocoa operations. I guess I need to now dig into the workings of CMake so as to understand what Sean is doing with his RogueResearch builds. Any further suggestions (Like Hey Corrie, buy the Cmake book!) will certainly be appreciated.</div>
<div>Corrie</div><div><span class="e" id="q_11847b4d5a6e60be_1"><div><br></div><div><div><div>On Feb 22, 2008, at 9:55 AM, David Cole wrote:</div><br><blockquote type="cite">Look at the code around line 222 of VTK/Rendering/vtkCocoaRenderWindowInteractor.mm<br>
<br>If you are getting that message, then the vtkEarlyCocoaSetup constructor is probably not being called. Maybe __OBJC_GC__ is defined, but there is a need for an autorelease pool anyhow....?<br> <br>Some of the RogueResearch mac VTK dashboards use this cache entry...<span style="font-family: monospace;"><br>
</span>VTK_REQUIRED_OBJCXX_FLAGS:STRING=-fobjc-gc<br><div><span class="gmail_quote">...to turn on objective C++ garbage collection.<br> <br>Are you doing that in some fashion for your build? Or is __OBJC_GC__ defined for your build somehow?<br>
<br><br>HTH,<br>David<br><br>On 2/21/08, <b class="gmail_sendername">Corrie Allen</b> <<a href="mailto:corrieallen@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">corrieallen@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="margin: 0px;">Hi VTK gurus,</div><div style="margin: 0px; min-height: 16px;"><br></div><div style="margin: 0px;">I'm getting this snippet of output in my log window during the run of a little program I've written.</div>
<div style="margin: 0px; min-height: 16px;">"</div><div style="margin: 0px;">Gonna initialize interactor next!</div><div style="margin: 0px;">And now starting interactor</div><div style="margin: 0px;">2008-02-21 20:03:26.496 spawar2[1365:10b] *** _NSAutoreleaseNoPool(): Object 0x13e22460 of class vtkCocoaServer autoreleased with no pool in place - just leaking</div>
<div style="margin: 0px;">Stack: (0x90a3012f 0x9093cec2 0xda040 0xdaa3c 0x702b 0x6176)</div><div style="margin: 0px; min-height: 16px;">"</div><div style="margin: 0px;">The c++ code where this is occurring is</div><div style="margin: 0px;">
....</div><div style="margin: 0px; color: rgb(196, 26, 22);"><span style="color: rgb(0, 0, 0);"> cout<<</span>"Gonna initialize interactor next!"<span style="color: rgb(0, 0, 0);"><<endl;</span></div>
<div style="margin: 0px;"> iren->Initialize();</div><div style="margin: 0px; color: rgb(196, 26, 22);"><span style="color: rgb(0, 0, 0);"> cout<< </span>"And now starting interactor"<span style="color: rgb(0, 0, 0);"><< endl;</span></div>
<div style="margin: 0px;"> iren->Start(); //where iren is an instance of vtkCocoaRenderWindowInteractor</div><div style="margin: 0px;">....</div><div style="margin: 0px;">The 3-D object is rendered fine after the log note appears and the interactor works well. The log output,though, is worrisome. Where can I begin to look for the cause of this: just leaking with no pool in place seems bad. </div>
<div style="margin: 0px; min-height: 16px;"><br></div><div style="margin: 0px;">Corrie</div><div style="margin: 0px; min-height: 16px;"><br></div><div style="margin: 0px;">MacBook Pro, OSX 10.5.1, CMake 2.4.8, VTK 5.1,</div>
<div style="margin: 0px;">i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)</div><div><font face="Geneva"><br></font></div> </div><br>_______________________________________________<br> This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/Wiki/VTK_FAQ</a><br> Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.vtk.org/mailman/listinfo/vtkusers</a><br> <br></blockquote></div><br></blockquote></div>
<br></div></span></div></div></blockquote></div><br>