<div class="gmail_quote">On Fri, Mar 5, 2010 at 9:04 AM, sercani <span dir="ltr"><<a href="mailto:sercanimailgroups@gmail.com">sercanimailgroups@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi everyone,<br>
I've written subclass of vtkInteractorStyleImage and set it to an interactor, but i need to set another custom interactorstyle in runtime. When i want to delete the current custom interactor style like this:<br>
if(cis->GetEnabled())<br>
{<br>
cis->EnabledOff();<br>
cis->SetInteractor(0);<br>
cis->Delete();<br>
}<br>
<br>
it throws :<br>
<br>
"ERROR: In ..\..\VTK_Source\VTK\Common\vtkObject.cxx, line 160<br>
vtkObject (0155E128): Trying to delete object with non-zero reference count."<br>
<br>
How can i delete this custom interactorstyle and set another custom interactorstyle as current interactor's new interactorstyle?<br><br></blockquote><div><br></div><div>Is cis a smart pointer? If so then you should let it delete itself instead of deleting it manually - or if you want to delete it manually then don't use a smart pointer. Can you send us some more code for context?</div>
<br clear="all">Thanks,<br><br><div>David</div></div>