<div class="gmail_quote">On Fri, Mar 5, 2010 at 9:04 AM, sercani <span dir="ltr">&lt;<a href="mailto:sercanimailgroups@gmail.com">sercanimailgroups@gmail.com</a>&gt;</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&#39;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-&gt;GetEnabled())<br>
    {<br>
        cis-&gt;EnabledOff();<br>
        cis-&gt;SetInteractor(0);<br>
        cis-&gt;Delete();<br>
    }<br>
<br>
it throws :<br>
<br>
&quot;ERROR: In ..\..\VTK_Source\VTK\Common\vtkObject.cxx, line 160<br>
vtkObject (0155E128): Trying to delete object with non-zero reference count.&quot;<br>
<br>
How can i delete this custom interactorstyle and set another custom interactorstyle as current interactor&#39;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&#39;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>