<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Thanks for the expeditious and detailed response Ken, I truly appreciate it. Perfect, this is exactly what I thought but needed the opinion of someone more experienced. I had a closer look at vtkActor and noticed how it checks the validity of it’s Mapper prior to releasing it (in its release graphics resource function) proof that it indeed needs to be released via calling ReleaseGraphicsResources sometime down the line. Thanks</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">   Seun.</div><div class=""> </div><div class=""><div><blockquote type="cite" class=""><div class="">On Aug 11, 2016, at 11:44 AM, Ken Martin <<a href="mailto:ken.martin@kitware.com" class="">ken.martin@kitware.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Yes you definitely want to call ReleaseGraphicsResources when you are done using a graphics object, but are not done using its window. Normally VTK handles this for you so you do not have to worry about it. <div class=""><br class=""></div><div class="">Many classes in VTK create and hold onto OpenGL resources. At some point those resources need to be freed. Normally before an OpenGL context/window is destroyed it will call ReleaseGraphicsResources on everything connected to it so that they are all freed before it releases the context. But if you have detached a mapper from the RenderWindow/Renderer/Actor (but not yet deleted it) then that does not happen. Then at some other point that mapper tries to free its resources but the context that owned them is already gone causing an error. </div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Ken<br class=""><div class=""><br class=""></div><div class=""><br class=""></div></div></div><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class="gmail_quote">On Thu, Aug 11, 2016 at 11:33 AM, Seun Odutola<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:seun@rogue-research.com" target="_blank" class="">seun@rogue-research.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class="">Hi Ken,<div class=""><br class=""></div><div class="">   <span class="Apple-converted-space"> </span>Thanks for the suggestion. I do have a little question though, is it a necessary convention to call release graphics resources on the old mapper prior to setting a new one? I was wondering judging from your statement (quick fix) if this was just a hack.</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">   <span class="Apple-converted-space"> </span>Seun<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Aug 8, 2016, at 1:00 PM, Ken Martin <<a href="mailto:ken.martin@kitware.com" target="_blank" class="">ken.martin@kitware.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">How do you change the mapper? Do you immediately destroy the old mapper or leave it around for  later? I suspect the old mapper is getting destroyed later than it should. One thing you can try as a quick fix is<div class=""><br class=""></div><div class="">actor->SetMapper(shiny new mapper);</div><div class="">oldMapper-><wbr class="">ReleaseGraphicsResources(<wbr class="">renWin or NULL if you don;t have the window handy)</div><div class="">...</div><div class=""><br class=""></div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Aug 4, 2016 at 3:21 PM, Seun Odutola<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:seun@rogue-research.com" target="_blank" class="">seun@rogue-research.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><p class="MsoNormal">Hello everyone,<u class=""></u><u class=""></u></p><p class="MsoNormal">     <span class="Apple-converted-space"> </span>I have a crash that occurs in my application when running vtk with the GL2 rendered enabled but not with GL1. So here is the situation, in my program when I change the shape of my poly data mapper, basically setting the mapper of an actor in my scene to a new poly data mapper it results in a crash.  The crash is  situated in vtkOpenGLBufferObject’s destructor, specifically the deletion of the Internal’s handle. I have tried to verify if the handle is valid prior to reaching the destructor which it seems to be, my main concern is if the handle is filled with garbage (a non-zero value) it might effectively pass the test condition and try to invoke glDeleteBuffer. Has anyone experienced anything similar to this?</p><div class="">Regards,</div><div class="">   Seun</div><p class="MsoNormal"><u class=""></u><u class=""></u></p></div><br class="">______________________________<wbr class="">_________________<br class="">Powered by<span class="Apple-converted-space"> </span><a href="http://www.kitware.com/" rel="noreferrer" target="_blank" class="">www.kitware.com</a><br class=""><br class="">Visit other Kitware open-source projects at<span class="Apple-converted-space"> </span><a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" class="">http://www.kitware.com/opensou<wbr class="">rce/opensource.html</a><br class=""><br class="">Search the list archives at:<span class="Apple-converted-space"> </span><a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank" class="">http://markmail.org/search/?q=<wbr class="">vtk-developers</a><br class=""><br class="">Follow this link to subscribe/unsubscribe:<br class=""><a href="http://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank" class="">http://public.kitware.com/mail<wbr class="">man/listinfo/vtk-developers</a><br class=""><br class=""><br class=""></blockquote></div><br class=""><br clear="all" class=""><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div data-smartmail="gmail_signature" class="">Ken Martin PhD<div class="">Chairman & CFO<br class="">Kitware Inc.<br class="">28 Corporate Drive<br class="">Clifton Park NY 12065<br class=""><a href="tel:518%20371%203971" value="+15183713971" target="_blank" class="">518 371 3971</a><div class=""><br class=""></div><div class=""><span style="font-size: 10pt; font-family: Tahoma, sans-serif;" class="">This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee.  Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message.  Thank you.</span></div></div></div></font></span></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature" data-smartmail="gmail_signature">Ken Martin PhD<div class="">Chairman & CFO<br class="">Kitware Inc.<br class="">28 Corporate Drive<br class="">Clifton Park NY 12065<br class="">518 371 3971<div class=""><br class=""></div><div class=""><span style="font-size: 10pt; font-family: Tahoma, sans-serif;" class="">This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee.  Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message.  Thank you.</span></div></div></div></div></div></blockquote></div><br class=""></div></body></html>