[vtkusers] breaking after vtkErrorMacro

David Cole david.cole at kitware.com
Fri Nov 7 09:46:30 EST 2008


Maybe try listening for ErrorEvent on the vtkOutputWindow::GetInstance()
object? (If there is no handler for the ErrorEvent on the specific object,
then the output window is called to display error text and it also emits an
ErrorEvent...)
HTH,
David


On Fri, Nov 7, 2008 at 9:41 AM, Dominik Szczerba <dominik at itis.ethz.ch>wrote:

> Thanks a lot, Goodwin already suggested this solution independently, but
> the thing is it is an object inside the filter that emits this event, and
> the filter is not catching it. Observing the filter did not help me here -
> or is there a way to enable 'recursive' events?
> with regards,
> Dominik
>
> Amy Squillacote wrote:
>
>> Hi Dominik,
>>
>>  From looking at the code in vtkSetGet.h for vtkErrorMacro, it seems that
>> if something is observing the "ErrorEvent", then that event is invoked.
>> Perhaps you could add an observer to the filter that has this problem --
>> specifically listening for the "ErrorEvent". Then you could exit gracefully
>> in your event handler.
>>
>> - Amy
>>
>> Dominik Szczerba wrote:
>>
>>> Thanks for a hint, but I need to handle this case in a release version
>>> (no debugger). I looked up the vtkErrorMacro and it indeed calls
>>> BreakOnError() at the end. Is there a chance to attach own code there?
>>>
>>> Thanks,
>>> Dominik
>>>
>>> Goodwin Lawlor wrote:
>>>
>>>> Dominik Szczerba wrote:
>>>>
>>>>> Is there a way to stop execution after vtkErrorMacro?
>>>>> I get a malloc failure in a VTK filter that is not checked for in the
>>>>> parent calling stack... (bug report due). pointer==0 is detected (if ptr==0
>>>>> vtkErrorMacro... return 0) but execution continues (leading into bushes).
>>>>> If not, what do I do to exit gracefully on a malloc quit?
>>>>>
>>>>
>>>> Hi Dominik,
>>>>
>>>> You can place a debugger break on vtkObject::BreakOnError()
>>>>
>>>> hth
>>>>
>>>> Goodwin
>>>>
>>>>
>>>
>>
> --
> Dominik Szczerba, PhD
> Computational Physics Group
> IT'IS Foundation for Research
> http://www.itis.ethz.ch
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081107/dbff8343/attachment.htm>


More information about the vtkusers mailing list